Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CODE] Declassify Game #3412

Open
3 tasks
j-gynn opened this issue Feb 6, 2025 · 2 comments
Open
3 tasks

[CODE] Declassify Game #3412

j-gynn opened this issue Feb 6, 2025 · 2 comments
Assignees
Labels
📍 Assigned enhancement New features or Change to Existing Features

Comments

@j-gynn
Copy link
Collaborator

j-gynn commented Feb 6, 2025

Description
Game (the class) and game (the object we call) don't need to exist the way they do. The Pythonic way of doing a singleton is through the Global Object Pattern. Related justification for why Singletons aren't used in Python.

The game-related functions can be placed into a file called game.py, which could be imported such that all previous calls to game.clan, game.switches etc. are all still functional without changes.

This would also (hopefully) mean that our tests can actually access things in game, or at least that we can write a pipeline function to build game and make it available to them. This should remove the confusing overhead we have of code intentionally taking a different route when running in tests (which is explicitly the opposite of what tests should do!).

This is tangentially related to #2515.

Requirements:

MUST

  • Remove class Game and game = Game()
  • Must NOT change calls to game elsewhere in code; i.e., ensure functionality is accessed in the exact same way as before
    • Where this is not possible, changes MUST be documented and clearly rationalised
@j-gynn j-gynn added the enhancement New features or Change to Existing Features label Feb 6, 2025
@rustykitty
Copy link
Contributor

/assign-me

Copy link

github-actions bot commented Feb 7, 2025

👋 Hey @rustykitty, thanks for your interest in this issue! 🎉

⚠ Note that this issue will become unassigned if it isn't closed within 7 days.

🔧 A maintainer can also add the 📌 Pinned label to prevent it from being unassigned automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📍 Assigned enhancement New features or Change to Existing Features
Projects
None yet
Development

No branches or pull requests

2 participants