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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tcod-ecs
3
- Version: 5.2.0
3
+ Version: 5.2.1
4
4
  Summary: A type-hinted Entity Component System based on Python dictionaries and sets.
5
5
  Author-email: Kyle Benesch <4b796c65+github@gmail.com>
6
6
  Requires-Python: >=3.8
@@ -12,7 +12,6 @@ from tcod.ecs.registry import Registry
12
12
  from tcod.ecs.registry import Registry as World
13
13
 
14
14
  __all__ = (
15
- "__version__",
16
15
  "Entity",
17
16
  "IsA",
18
17
  "Registry",
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '5.2.0'
16
- __version_tuple__ = version_tuple = (5, 2, 0)
15
+ __version__ = version = '5.2.1'
16
+ __version_tuple__ = version_tuple = (5, 2, 1)
@@ -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
- def get(self, __key: ComponentKey[T], __default: T | None = None) -> T | None:
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