Resolving pylance error
This commit is contained in:
parent
a287784328
commit
c7e8804183
@ -190,7 +190,9 @@ class Play(Base):
|
||||
@property
|
||||
def ai_is_batting(self) -> bool:
|
||||
"""Determine if current batting team is AI-controlled"""
|
||||
if self.half == 'top':
|
||||
# Type cast for Pylance - at runtime self.half is a string, not a Column
|
||||
half_value: str = self.half # type: ignore[assignment]
|
||||
if half_value == 'top':
|
||||
return self.game.away_team_is_ai
|
||||
else:
|
||||
return self.game.home_team_is_ai
|
||||
@ -198,7 +200,9 @@ class Play(Base):
|
||||
@property
|
||||
def ai_is_fielding(self) -> bool:
|
||||
"""Determine if current fielding team is AI-controlled"""
|
||||
if self.half == 'top':
|
||||
# Type cast for Pylance - at runtime self.half is a string, not a Column
|
||||
half_value: str = self.half # type: ignore[assignment]
|
||||
if half_value == 'top':
|
||||
return self.game.home_team_is_ai
|
||||
else:
|
||||
return self.game.away_team_is_ai
|
||||
|
||||
Loading…
Reference in New Issue
Block a user