Skip to content

Commit f33ad3c

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

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test = [
3434
"pytest >=7.2.0",
3535
"pytest-cov >=4.0.0",
3636
"pytest-benchmark >=4.0.0",
37-
"mypy >=1.1.1",
37+
"mypy >=1.17.0",
3838
]
3939

4040
[tool.flit.module]

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)