Skip to content

Change the use of class variables to instance variables to resolve issues in free-threaded builds #84

@Apricot-S

Description

@Apricot-S

Summary

Track and implement changes required for supporting the free-threaded build of CPython (PEP 703).
This work was split out from #79 (Python 3.14 support).

Background

  • Python 3.14 introduces official support for free-threaded builds.
  • Current code has class variables that may cause race conditions or unsafe access in a free-threaded environment.
  • To ensure compatibility and stability, these class variables should be migrated to instance variables or local variables.

Tasks

  • Identify all class variables that are shared across threads.
  • Replace them with instance variables where appropriate.

Investigation Targets

  • mahjong/
    • __init__.py
      • (none)
    • agari.py
      • (none)
    • constants.py
      • (none)
    • meld.py
      • Meld
    • shanten.py
      • Shanten
    • tile.py
      • Tile
    • utils.py
      • (none)
    • hand_calculating/
      • __init__.py
        • (none)
      • divider.py
        • HandDivider
      • fu.py
        • (none)
      • hand_config.py
        • OptionalRules
        • HandConfig
      • hand_response.py
        • HandResponse
      • hand.py
        • HandCalculator
      • scores.py
        • (none)
      • yaku_config.py
        • (none)
      • yaku.py
        • Yaku
      • yaku_list/
        • __init__.py
        • yakuman/
          • __init__.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions