tcod-ecs 5.2.0__tar.gz → 5.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tcod_ecs-5.2.0 → tcod_ecs-5.2.1}/PKG-INFO +1 -1
- {tcod_ecs-5.2.0 → tcod_ecs-5.2.1}/tcod/ecs/__init__.py +0 -1
- {tcod_ecs-5.2.0 → tcod_ecs-5.2.1}/tcod/ecs/_version.py +2 -2
- {tcod_ecs-5.2.0 → tcod_ecs-5.2.1}/tcod/ecs/entity.py +7 -2
- {tcod_ecs-5.2.0 → tcod_ecs-5.2.1}/LICENSE +0 -0
- {tcod_ecs-5.2.0 → tcod_ecs-5.2.1}/README.md +0 -0
- {tcod_ecs-5.2.0 → tcod_ecs-5.2.1}/pyproject.toml +0 -0
- {tcod_ecs-5.2.0 → tcod_ecs-5.2.1}/tcod/ecs/_converter.py +0 -0
- {tcod_ecs-5.2.0 → tcod_ecs-5.2.1}/tcod/ecs/callbacks.py +0 -0
- {tcod_ecs-5.2.0 → tcod_ecs-5.2.1}/tcod/ecs/constants.py +0 -0
- {tcod_ecs-5.2.0 → tcod_ecs-5.2.1}/tcod/ecs/py.typed +0 -0
- {tcod_ecs-5.2.0 → tcod_ecs-5.2.1}/tcod/ecs/query.py +0 -0
- {tcod_ecs-5.2.0 → tcod_ecs-5.2.1}/tcod/ecs/registry.py +0 -0
- {tcod_ecs-5.2.0 → tcod_ecs-5.2.1}/tcod/ecs/typing.py +0 -0
- {tcod_ecs-5.2.0 → tcod_ecs-5.2.1}/tcod/ecs/world.py +0 -0
|
@@ -529,12 +529,17 @@ class EntityComponents(MutableMapping[Union[Type[Any], Tuple[object, Type[Any]]]
|
|
|
529
529
|
self.update(value)
|
|
530
530
|
return self
|
|
531
531
|
|
|
532
|
-
|
|
532
|
+
@overload
|
|
533
|
+
def get(self, __key: ComponentKey[T]) -> T | None: ...
|
|
534
|
+
@overload
|
|
535
|
+
def get(self, __key: ComponentKey[T], __default: _T1) -> T | _T1: ...
|
|
536
|
+
|
|
537
|
+
def get(self, __key: ComponentKey[T], __default: _T1 | None = None) -> T | _T1:
|
|
533
538
|
"""Return a component, returns None or a default value when the component is missing."""
|
|
534
539
|
try:
|
|
535
540
|
return self[__key]
|
|
536
541
|
except KeyError:
|
|
537
|
-
return __default
|
|
542
|
+
return __default # type: ignore[return-value] # https://github.com/python/mypy/issues/3737
|
|
538
543
|
|
|
539
544
|
def setdefault(self, __key: ComponentKey[T], __default: T) -> T: # type: ignore[override]
|
|
540
545
|
"""Assign a default value if a component is missing, then returns the current value."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|