stdlib: Add several missing __(deep)copy__ methods (#7242)

This commit is contained in:
Alex Waygood
2022-02-17 02:57:41 +00:00
committed by GitHub
parent d869f2e5a3
commit 1091521f60
7 changed files with 26 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ import sys
from _typeshed import Self
from decimal import Decimal
from numbers import Integral, Rational, Real
from typing import Union, overload
from typing import Any, Union, overload
from typing_extensions import Literal
_ComparableNum = Union[int, float, Decimal, Real]
@@ -135,6 +135,8 @@ class Fraction(Rational):
def __le__(self, other: _ComparableNum) -> bool: ...
def __ge__(self, other: _ComparableNum) -> bool: ...
def __bool__(self) -> bool: ...
def __copy__(self: Self) -> Self: ...
def __deepcopy__(self: Self, memo: Any) -> Self: ...
if sys.version_info >= (3, 11):
def __int__(self) -> int: ...
# Not actually defined within fractions.py, but provides more useful