I have a base class that represents the state of a game and provides a perform_move
method:
class GameState:
# other code
def perform_move(self, position: LinePosition) -> MoveResult:
# more code
Now I want to create a subclass of GameState
that keeps track of the players' score.
Because the base class doesn't care about players (separation of concerns), I need an additional argument to identify the player that is performing the move.
I tried the following:
class ScoreKeepingGameState(GameState):
# other code
def perform_move(self, position: LinePosition, *, player_identification: Optional[int] = None) -> MoveResult:
# more code
I expected this to work, since I can call ScoreKeepingGameState
's perform_move
perfectly fine without the player_identification
, alas pylint complains:
W0221: Parameters differ from overridden 'perform_move' method (arguments-differ)
Is there a cleaner approach to satisfy pylint than adding # pylint: disable=arguments-differ
to the perform_move
definition of ScoreKeepingGameState
?