Skip to content

Resolve type inconsistencies in is_condition_met() across Yaku subclasses #122

@Apricot-S

Description

@Apricot-S

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions