Skip to content

Commit 92cc6ab

Browse files
committed
Deprecate old World name at typing level
1 parent 0bbf97b commit 92cc6ab

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tcod/ecs/__init__.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,21 @@
44

55
import importlib.metadata
66
from collections import defaultdict
7-
from typing import TypeVar
7+
from typing import TYPE_CHECKING, TypeVar
88

99
from tcod.ecs.constants import IsA
1010
from tcod.ecs.entity import Entity
1111
from tcod.ecs.registry import Registry
12-
from tcod.ecs.registry import Registry as World
12+
13+
if TYPE_CHECKING:
14+
from typing_extensions import deprecated
15+
16+
@deprecated("Renamed to Registry.")
17+
class World(Registry): # noqa: D101
18+
pass
19+
20+
else:
21+
from tcod.ecs.registry import Registry as World
1322

1423
__all__ = (
1524
"Entity",

0 commit comments

Comments
 (0)