Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basketball - Add player and team typehints #616

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions espn_api/basketball/league.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from .constant import POSITION_MAP, ACTIVITY_MAP, TRANSACTION_TYPES

class League(BaseLeague):
teams: List[Team]
'''Creates a League instance for Public/Private ESPN league'''
def __init__(self, league_id: int, year: int, espn_s2=None, swid=None, fetch_league=True, debug=False):
super().__init__(league_id=league_id, year=year, sport='nba', espn_s2=espn_s2, swid=swid, debug=debug)
Expand Down
4 changes: 3 additions & 1 deletion espn_api/basketball/team.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import List

from .player import Player
from .matchup import Matchup
from .constant import STATS_MAP
Expand All @@ -23,7 +25,7 @@ def __init__(self, data, roster, schedule, year, **kwargs):
self.stats = None
self.standing = data['playoffSeed']
self.final_standing = data['rankCalculatedFinal']
self.roster = []
self.roster: List[Player] = []
self.schedule = []

if 'valuesByStat' in data:
Expand Down
Loading