mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Improve a bunch of __(deep)copy__ methods (#7148)
This commit is contained in:
@@ -146,8 +146,8 @@ class Decimal:
|
||||
def scaleb(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
|
||||
def shift(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
|
||||
def __reduce__(self) -> tuple[type[Decimal], tuple[str]]: ...
|
||||
def __copy__(self) -> Decimal: ...
|
||||
def __deepcopy__(self, __memo: Any) -> Decimal: ...
|
||||
def __copy__(self: Self) -> Self: ...
|
||||
def __deepcopy__(self: Self, __memo: Any) -> Self: ...
|
||||
def __format__(self, __specifier: str, __context: Context | None = ...) -> str: ...
|
||||
|
||||
class _ContextManager:
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
from _typeshed import Self
|
||||
from collections.abc import Mapping
|
||||
from typing import Any
|
||||
|
||||
class _TokenType(tuple[str, ...]):
|
||||
parent: _TokenType | None
|
||||
@@ -6,8 +8,8 @@ class _TokenType(tuple[str, ...]):
|
||||
subtypes: set[_TokenType]
|
||||
def __contains__(self, val: _TokenType) -> bool: ... # type: ignore[override]
|
||||
def __getattr__(self, name: str) -> _TokenType: ...
|
||||
def __copy__(self): ...
|
||||
def __deepcopy__(self, memo): ...
|
||||
def __copy__(self: Self) -> Self: ...
|
||||
def __deepcopy__(self: Self, memo: Any) -> Self: ...
|
||||
|
||||
Token: _TokenType
|
||||
Text: _TokenType
|
||||
|
||||
@@ -44,8 +44,8 @@ class LazyProxy:
|
||||
def __delitem__(self, key) -> None: ...
|
||||
def __getitem__(self, key): ...
|
||||
def __setitem__(self, key, value) -> None: ...
|
||||
def __copy__(self): ...
|
||||
def __deepcopy__(self, memo): ...
|
||||
def __copy__(self) -> LazyProxy: ...
|
||||
def __deepcopy__(self, memo: Any) -> LazyProxy: ...
|
||||
|
||||
class NullTranslations(gettext.NullTranslations):
|
||||
DEFAULT_DOMAIN: Any
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Self
|
||||
from typing import Any
|
||||
|
||||
from .config import Config
|
||||
@@ -61,7 +62,7 @@ class Call:
|
||||
self, task: Task, called_as: str | None = ..., args: tuple[Any, ...] | None = ..., kwargs: dict[str, Any] | None = ...
|
||||
) -> None: ...
|
||||
def __getattr__(self, name: str) -> Any: ...
|
||||
def __deepcopy__(self, memo: Any) -> Task: ...
|
||||
def __deepcopy__(self: Self, memo: Any) -> Self: ...
|
||||
def __eq__(self, other: Call) -> bool: ... # type: ignore[override]
|
||||
def make_context(self, config: Config) -> Context: ...
|
||||
def clone_data(self): ...
|
||||
|
||||
@@ -12,7 +12,7 @@ _M = TypeVar("_M", bound=Message) # message type (of self)
|
||||
|
||||
class Message:
|
||||
DESCRIPTOR: Descriptor
|
||||
def __deepcopy__(self, memo=...): ...
|
||||
def __deepcopy__(self: Self, memo: Any = ...) -> Self: ...
|
||||
def __eq__(self, other_msg): ...
|
||||
def __ne__(self, other_msg): ...
|
||||
def MergeFrom(self: Self, other_msg: Self) -> None: ...
|
||||
|
||||
@@ -51,5 +51,5 @@ class StripeObject(dict[Any, Any]):
|
||||
@property
|
||||
def stripe_id(self): ...
|
||||
def serialize(self, previous): ...
|
||||
def __copy__(self): ...
|
||||
def __deepcopy__(self, memo): ...
|
||||
def __copy__(self) -> StripeObject: ...
|
||||
def __deepcopy__(self, memo: Any) -> StripeObject: ...
|
||||
|
||||
Reference in New Issue
Block a user