Skip to content

Commit

Permalink
Apparently I was using the wrong ignore code
Browse files Browse the repository at this point in the history
  • Loading branch information
Matiiss committed Aug 12, 2024
1 parent 38131a7 commit 8f1f29b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion buildconfig/stubs/pygame/sprite.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ _TDirtySprite = TypeVar("_TDirtySprite", bound=_DirtySpriteSupportsGroup)
class AbstractGroup(Generic[_TSprite]):
spritedict: Dict[_TSprite, Optional[Union[FRect, Rect]]]
lostsprites: List[Union[FRect, Rect]]
def __class_getitem__(cls, generic: Any) -> typing._GenericAlias: ... # type: ignore[attr-defined]
def __class_getitem__(cls, generic: Any) -> typing._GenericAlias: ... # type: ignore[name-defined]
def __init__(self) -> None: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[_TSprite]: ...
Expand Down
2 changes: 1 addition & 1 deletion src_py/sprite.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def __class_getitem__(cls, generic):
# switch to `types.GenericAlias` once Python 3.8 support is dropped
import typing

return typing._GenericAlias(cls, generic) # type: ignore[attr-defined]
return typing._GenericAlias(cls, generic) # type: ignore[name-defined]

# protected identifier value to identify sprite groups, and avoid infinite recursion
_spritegroup = True
Expand Down
2 changes: 1 addition & 1 deletion test/sprite_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ def test_type_subscript(self):
# switch to `types.GenericAlias` once Python 3.8 support is dropped
import typing

self.assertIsInstance(group_generic_alias, typing._GenericAlias) # type: ignore[attr-defined]
self.assertIsInstance(group_generic_alias, typing._GenericAlias) # type: ignore[name-defined]
self.assertIs(typing.get_origin(group_generic_alias), sprite.Group)
self.assertEqual(typing.get_args(group_generic_alias), (sprite.Sprite,))

Expand Down

0 comments on commit 8f1f29b

Please sign in to comment.