-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Milestone
Description
Summary
Some Yaku subclasses override is_condition_met() with signatures that are not type‑compatible with the base class.
This causes mypy errors and violates Liskov substitution principles.
Unifying these method signatures may require API changes and could become a breaking change.
Example
class Yaku:
def is_condition_met(self, hand: Collection[Sequence[int]], *args) -> bool: ...
class SanKantsu(Yaku):
def is_condition_met(self, hand: Collection[Sequence[int]], melds: Collection[Meld], *args) -> bool: ...
class KokushiMusou(Yaku):
def is_condition_met(self, hand: Optional[Collection[Sequence[int]]], tiles_34: Sequence[int], *args) -> bool: ...Scope
- Identify all Yaku subclasses whose
is_condition_met()signatures differ from the base class - Refactor the method signatures to be type‑compatible
e.g., unify parameters, use*args/**kwargs, or redesign the API if needed - Ensure mypy passes without suppressions
- Confirm that behavior remains correct after refactoring
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels