Skip to content

Commit 1bb8aea

Browse files
committed
Update type ignores for latest Mypy
1 parent fa77284 commit 1bb8aea

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tcod/ecs/_converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def _is_defaultdict_type(type_hint: object) -> bool:
1414

1515
def _setup_defaultdict_factory(type_hint: type[defaultdict[Any, Any] | object]) -> Callable[[], Any]:
1616
"""Return the factory value for a defaultdict given its value type-hint."""
17-
assert type_hint is not Any # type: ignore[comparison-overlap]
17+
assert type_hint is not Any
1818
if get_origin(type_hint) is not defaultdict:
1919
return get_origin(type_hint) or type_hint
2020
return functools.partial(defaultdict, _setup_defaultdict_factory(get_args(type_hint)[1]))

tcod/ecs/entity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ def get(self, __key: ComponentKey[T], /, default: _T1 | None = None) -> T | _T1:
544544
except KeyError:
545545
return default # type: ignore[return-value] # https://github.com/python/mypy/issues/3737
546546

547-
def setdefault(self, __key: ComponentKey[T], __default: T, /) -> T:
547+
def setdefault(self, __key: ComponentKey[T], __default: T, /) -> T: # type: ignore[override] # Disallows default None
548548
"""Assign a default value if a component is missing, then returns the current value."""
549549
try:
550550
return self[__key]

0 commit comments

Comments
 (0)