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

@@ -635,6 +635,8 @@ class Match(Generic[AnyStr]):
def __getitem__(self, __key: _Literal[0]) -> AnyStr: ...
@overload
def __getitem__(self, __key: int | str) -> AnyStr | Any: ...
def __copy__(self) -> Match[AnyStr]: ...
def __deepcopy__(self, __memo: Any) -> Match[AnyStr]: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
@@ -658,6 +660,8 @@ class Pattern(Generic[AnyStr]):
def subn(self, repl: AnyStr, string: AnyStr, count: int = ...) -> tuple[AnyStr, int]: ...
@overload
def subn(self, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = ...) -> tuple[AnyStr, int]: ...
def __copy__(self) -> Pattern[AnyStr]: ...
def __deepcopy__(self, __memo: Any) -> Pattern[AnyStr]: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...