We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f80b33f commit 608bd7fCopy full SHA for 608bd7f
src/pygambit/catalog/catalog.py
@@ -26,11 +26,9 @@ class CatalogGame:
26
27
def __new__(cls, *args, **kwargs) -> Game:
28
"""Create a game instance by calling the _game() method."""
29
- if hasattr(cls, "_game") and cls._game is not CatalogGame._game:
30
- if cls._cached_game is None:
31
- cls._cached_game = cls._game(*args, **kwargs)
32
- return cls._cached_game
33
- raise NotImplementedError("Subclasses must implement _game() method")
+ if cls._cached_game is None:
+ cls._cached_game = cls._game(*args, **kwargs)
+ return cls._cached_game
34
35
@staticmethod
36
def _game() -> Game:
0 commit comments