Skip to content

Commit 4e540dd

Browse files
committed
Update type ignores for latest Mypy
Requires Python 3.9 to run latest Mypy
1 parent fa77284 commit 4e540dd

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.github/workflows/python-package.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
runs-on: ubuntu-latest
2828
strategy:
2929
matrix:
30-
python-version: ["3.8", "3.12"]
30+
python-version: ["3.9", "3.12"]
3131
steps:
3232
- uses: actions/checkout@v4
3333
- uses: actions/setup-python@v5
@@ -46,7 +46,8 @@ jobs:
4646
runs-on: ubuntu-latest
4747
strategy:
4848
matrix:
49-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev"]
49+
python-version:
50+
["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev"]
5051
steps:
5152
- uses: actions/checkout@v4
5253
- uses: actions/setup-python@v5

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)