diff --git a/buildconfig/stubs/pygame/cursors.pyi b/buildconfig/stubs/pygame/cursors.pyi index d75a66cc77..0bd2d77c6d 100644 --- a/buildconfig/stubs/pygame/cursors.pyi +++ b/buildconfig/stubs/pygame/cursors.pyi @@ -82,7 +82,7 @@ class Cursor: def __getitem__( self, index: int ) -> Union[int, IntCoordinate, Surface]: ... - copy = __copy__ + def copy(self) -> Cursor: ... type: Literal["system", "color", "bitmap"] data: Union[ Tuple[int], diff --git a/buildconfig/stubs/pygame/geometry.pyi b/buildconfig/stubs/pygame/geometry.pyi index 14ab6563b0..135b806cc8 100644 --- a/buildconfig/stubs/pygame/geometry.pyi +++ b/buildconfig/stubs/pygame/geometry.pyi @@ -113,5 +113,5 @@ class Circle: def rotate_ip(self, angle: float, /) -> None: ... def as_rect(self) -> Rect: ... def as_frect(self) -> FRect: ... + def copy(self) -> Circle: ... def __copy__(self) -> Circle: ... - copy = __copy__ diff --git a/buildconfig/stubs/pygame/mask.pyi b/buildconfig/stubs/pygame/mask.pyi index 0ea50adeb6..667bc7f7b7 100644 --- a/buildconfig/stubs/pygame/mask.pyi +++ b/buildconfig/stubs/pygame/mask.pyi @@ -17,7 +17,7 @@ def from_threshold( class Mask: def __init__(self, size: Coordinate, fill: bool = False) -> None: ... def __copy__(self) -> Mask: ... - copy = __copy__ + def copy(self) -> Mask: ... def get_size(self) -> Tuple[int, int]: ... def get_rect(self, **kwargs: Any) -> Rect: ... # Dict type needs to be completed def get_at(self, pos: Coordinate) -> int: ... diff --git a/buildconfig/stubs/pygame/math.pyi b/buildconfig/stubs/pygame/math.pyi index b994bcdab4..4526960b5a 100644 --- a/buildconfig/stubs/pygame/math.pyi +++ b/buildconfig/stubs/pygame/math.pyi @@ -65,7 +65,7 @@ class _GenericVector(Collection[float]): @overload def __imul__(self: _TVec, other: float) -> _TVec: ... def __copy__(self: _TVec) -> _TVec: ... - copy = __copy__ + def copy(self: _TVec) -> _TVec: ... def __safe_for_unpickling__(self) -> Literal[True]: ... def __contains__(self, other: float) -> bool: ... # type: ignore[override] def dot(self: _TVec, other: Union[SequenceLike[float], _TVec], /) -> float: ... diff --git a/buildconfig/stubs/pygame/rect.pyi b/buildconfig/stubs/pygame/rect.pyi index 79acedeab9..6e55ce45d7 100644 --- a/buildconfig/stubs/pygame/rect.pyi +++ b/buildconfig/stubs/pygame/rect.pyi @@ -143,7 +143,7 @@ class _GenericRect(Collection[_N]): @overload def __setitem__(self, key: slice, value: Union[float, RectLike]) -> None: ... def __copy__(self) -> Self: ... - copy = __copy__ + def copy(self) -> Self: ... @overload def move(self, x: float, y: float, /) -> Self: ... @overload diff --git a/buildconfig/stubs/pygame/surface.pyi b/buildconfig/stubs/pygame/surface.pyi index e9a97e070f..697944313c 100644 --- a/buildconfig/stubs/pygame/surface.pyi +++ b/buildconfig/stubs/pygame/surface.pyi @@ -64,7 +64,7 @@ class Surface: ) -> None: ... def __copy__(self) -> Surface: ... def __deepcopy__(self, memo) -> Surface: ... - copy = __copy__ + def copy(self) -> Surface: ... def blit( self, source: Surface, diff --git a/src_py/cursors.py b/src_py/cursors.py index 7fa7f99315..342bce0313 100644 --- a/src_py/cursors.py +++ b/src_py/cursors.py @@ -106,12 +106,12 @@ def __eq__(self, other): def __ne__(self, other): return not self.__eq__(other) - def __copy__(self): + def copy(self): """Clone the current Cursor object. You can do the same thing by doing Cursor(Cursor).""" return self.__class__(self) - copy = __copy__ + __copy__ = copy def __hash__(self): return hash(tuple([self.type] + list(self.data)))