Skip to content

Commit

Permalink
minimize diff
Browse files Browse the repository at this point in the history
  • Loading branch information
Matiiss committed Nov 24, 2024
1 parent dd698a7 commit 35fffad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 7 additions & 9 deletions buildconfig/stubs/pygame/sprite.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ from typing import (
TypeVar,
Union,
)
from typing_extensions import deprecated # added in 3.13
from typing_extensions import deprecated # added in 3.13

from pygame.rect import FRect, Rect
from pygame.surface import Surface
Expand Down Expand Up @@ -187,12 +187,10 @@ class Group(AbstractGroup[_TSprite]):
# these are aliased in the code too
@deprecated("Use `pygame.sprite.Group` instead")
class RenderPlain(Group): ...

@deprecated("Use `pygame.sprite.Group` instead")
class RenderClear(Group): ...

class RenderUpdates(Group[_TSprite]): ...

@deprecated("Use `pygame.sprite.RenderUpdates` instead")
class OrderedUpdates(RenderUpdates[_TSprite]): ...

Expand All @@ -204,7 +202,7 @@ class LayeredUpdates(AbstractGroup[_TSprite]):
AbstractGroup[_TSprite],
Iterable[Union[_TSprite, AbstractGroup[_TSprite]]],
],
**kwargs: Any,
**kwargs: Any
) -> None: ...
def add(
self,
Expand All @@ -213,7 +211,7 @@ class LayeredUpdates(AbstractGroup[_TSprite]):
AbstractGroup[_TSprite],
Iterable[Union[_TSprite, AbstractGroup[_TSprite]]],
],
**kwargs: Any,
**kwargs: Any
) -> None: ...
def get_sprites_at(self, pos: Point) -> List[_TSprite]: ...
def get_sprite(self, idx: int) -> _TSprite: ...
Expand Down Expand Up @@ -242,10 +240,10 @@ class LayeredDirty(LayeredUpdates[_TDirtySprite]):
def set_timing_threshold(
self, time_ms: SupportsFloat
) -> None: ... # This actually accept any value
@deprecated(
"since 2.1.1. Use `pygame.sprite.LayeredDirty.set_timing_threshold` instead"
)
def set_timing_treshold(self, time_ms: SupportsFloat) -> None: ...
@deprecated("since 2.1.1. Use `pygame.sprite.LayeredDirty.set_timing_threshold` instead")
def set_timing_treshold(
self, time_ms: SupportsFloat
) -> None: ...

class GroupSingle(AbstractGroup[_TSprite]):
sprite: _TSprite
Expand Down
4 changes: 2 additions & 2 deletions src_py/sprite.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@
# specialized cases.

import types
from typing import Optional
from warnings import warn
from typing import Optional

import pygame
from pygame.mask import from_surface
from pygame.rect import Rect
from pygame.time import get_ticks
from pygame.mask import from_surface


class Sprite:
Expand Down
4 changes: 3 additions & 1 deletion test/sprite_test.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#################################### IMPORTS ###################################


import types
import typing
import unittest

import pygame
from pygame import sprite


################################# MODULE LEVEL #################################


Expand Down Expand Up @@ -1372,8 +1374,8 @@ def test_memoryleak_bug(self):
# For memory leak bug posted to mailing list by Tobias Steinrücken on 16/11/10.
# Fixed in revision 2953.

import gc
import weakref
import gc

class MySprite(sprite.Sprite):
def __init__(self, *args, **kwargs):
Expand Down

0 comments on commit 35fffad

Please sign in to comment.