mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
dataclasses: change hash to unsafe_hash, add a minor overload (#3892)
Co-authored-by: hauntsaninja <>
This commit is contained in:
@@ -20,6 +20,9 @@ def astuple(obj: Any, *, tuple_factory: Callable[[List[Any]], _T]) -> _T: ...
|
||||
@overload
|
||||
def dataclass(_cls: Type[_T]) -> Type[_T]: ...
|
||||
|
||||
@overload
|
||||
def dataclass(_cls: None) -> Callable[[Type[_T]], Type[_T]]: ...
|
||||
|
||||
@overload
|
||||
def dataclass(*, init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ...,
|
||||
unsafe_hash: bool = ..., frozen: bool = ...) -> Callable[[Type[_T]], Type[_T]]: ...
|
||||
@@ -65,7 +68,7 @@ class InitVar(Generic[_T]): ...
|
||||
|
||||
def make_dataclass(cls_name: str, fields: Iterable[Union[str, Tuple[str, type], Tuple[str, type, Field[Any]]]], *,
|
||||
bases: Tuple[type, ...] = ..., namespace: Optional[Dict[str, Any]] = ...,
|
||||
init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., hash: bool = ...,
|
||||
init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., unsafe_hash: bool = ...,
|
||||
frozen: bool = ...) -> type: ...
|
||||
|
||||
def replace(obj: _T, **changes: Any) -> _T: ...
|
||||
|
||||
@@ -37,9 +37,7 @@ contextvars.Context.__init__
|
||||
contextvars.Context.get
|
||||
copy.PyStringMap
|
||||
ctypes.CDLL.__init__
|
||||
dataclasses.dataclass
|
||||
dataclasses.field
|
||||
dataclasses.make_dataclass
|
||||
email.message.MIMEPart.as_string
|
||||
enum.Enum._generate_next_value_
|
||||
gettext.NullTranslations.npgettext
|
||||
|
||||
@@ -89,7 +89,6 @@ contextvars.ContextVar.set
|
||||
copy.PyStringMap
|
||||
dataclasses.dataclass
|
||||
dataclasses.field
|
||||
dataclasses.make_dataclass
|
||||
dataclasses.replace
|
||||
decimal.Decimal.from_float
|
||||
decimal.setcontext
|
||||
|
||||
5
third_party/3/dataclasses.pyi
vendored
5
third_party/3/dataclasses.pyi
vendored
@@ -20,6 +20,9 @@ def astuple(obj: Any, *, tuple_factory: Callable[[List[Any]], _T]) -> _T: ...
|
||||
@overload
|
||||
def dataclass(_cls: Type[_T]) -> Type[_T]: ...
|
||||
|
||||
@overload
|
||||
def dataclass(_cls: None) -> Callable[[Type[_T]], Type[_T]]: ...
|
||||
|
||||
@overload
|
||||
def dataclass(*, init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ...,
|
||||
unsafe_hash: bool = ..., frozen: bool = ...) -> Callable[[Type[_T]], Type[_T]]: ...
|
||||
@@ -65,7 +68,7 @@ class InitVar(Generic[_T]): ...
|
||||
|
||||
def make_dataclass(cls_name: str, fields: Iterable[Union[str, Tuple[str, type], Tuple[str, type, Field[Any]]]], *,
|
||||
bases: Tuple[type, ...] = ..., namespace: Optional[Dict[str, Any]] = ...,
|
||||
init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., hash: bool = ...,
|
||||
init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., unsafe_hash: bool = ...,
|
||||
frozen: bool = ...) -> type: ...
|
||||
|
||||
def replace(obj: _T, **changes: Any) -> _T: ...
|
||||
|
||||
Reference in New Issue
Block a user