@@ -27,9 +27,7 @@ from pygame.rect import FRect, Rect
2727from pygame .surface import Surface
2828from pygame .typing import Point , RectLike
2929
30- # define some useful protocols first, which sprite functions accept
31- # sprite functions don't need all sprite attributes to be present in the
32- # arguments passed, they only use a few which are marked in the below protocols
30+ # Some sprite functions only need objects with certain attributes, not always a sprite
3331class _HasRect (Protocol ):
3432 @property
3533 def rect (self ) -> Optional [Union [FRect , Rect ]]: ...
@@ -44,7 +42,7 @@ class _HasMaskAndRect(_HasRect, Protocol):
4442 @property
4543 def mask (self ) -> Mask : ...
4644
47- class Sprite :
45+ class Sprite ( _HasImageAndRect ) :
4846 @property
4947 def image (self ) -> Optional [Surface ]: ...
5048 @image .setter
@@ -112,7 +110,7 @@ class AbstractGroup(Generic[_SpriteT]):
112110class Group (AbstractGroup [_SpriteT ]):
113111 def __init__ (self , * sprites : _SpriteOrSprites [_SpriteT ]) -> None : ...
114112
115- # these are aliased in the code too
113+ # These deprecated types are just aliases in the code too
116114@deprecated ("Use `pygame.sprite.Group` instead" )
117115class RenderPlain (Group [_SpriteT ]): ...
118116
@@ -184,7 +182,7 @@ class collide_circle_ratio:
184182 self , left : _SupportsCollideCircle , right : _SupportsCollideCircle
185183 ) -> bool : ...
186184
187- # Argument to collide_mask must either have mask or have image attribute, in
185+ # Arguments to collide_mask must either have mask or have image attribute, in
188186# addition to mandatorily having a rect attribute
189187_SupportsCollideMask = Union [_HasImageAndRect , _HasMaskAndRect ]
190188
0 commit comments