Skip to content

Commit

Permalink
Add return types to chart data methods
Browse files Browse the repository at this point in the history
We should try to do this everywhere we can as it just makes the code a
bit easier to read and helps with IDE autocompletion.
  • Loading branch information
XanderRiga committed Aug 13, 2020
1 parent c7d60cb commit 1255965
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pyracing/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ async def event_results(
return [historical_data.EventResults(x) for
x in response.json()["d"]["r"]]

async def irating(self, cust_id, category):
async def irating(self, cust_id, category) -> \
chart_data.ChartData[chart_data.IRating]:
""" Utilizes the stats_chart class to return a list of iRating values
that are used in the /CareerStats charts. Accessing
get_irating().current() will give the most recent irating of a cust_id
Expand All @@ -392,7 +393,8 @@ async def irating(self, cust_id, category):
type=chart_type,
content=ir_list)

async def ttrating(self, cust_id, category):
async def ttrating(self, cust_id, category) -> \
chart_data.ChartData[chart_data.TTRating]:
""" Utilizes the stats_chart class to return a list of ttrating values
that are used in the /CareerStats charts.
"""
Expand All @@ -410,7 +412,8 @@ async def ttrating(self, cust_id, category):
type=chart_type,
content=ttrating_list)

async def license_class(self, cust_id, category):
async def license_class(self, cust_id, category) -> \
chart_data.ChartData[chart_data.LicenseClass]:
""" Utilizes the stats_chart class to return a list of license values
that are used in the /CareerStats charts. See the LicenseClass class
for how to further use this data.
Expand Down

0 comments on commit 1255965

Please sign in to comment.