Add weakref_slot parameter to @dataclass decorator (#7772)

https://github.com/python/cpython/pull/92160
This commit is contained in:
Sam Ezeh
2022-05-03 10:37:06 +01:00
committed by GitHub
parent 4bcb1a95ab
commit ef878e925f

View File

@@ -79,7 +79,23 @@ else:
@overload
def dataclass(_cls: None) -> Callable[[type[_T]], type[_T]]: ...
if sys.version_info >= (3, 10):
if sys.version_info >= (3, 11):
@overload
def dataclass(
*,
init: bool = ...,
repr: bool = ...,
eq: bool = ...,
order: bool = ...,
unsafe_hash: bool = ...,
frozen: bool = ...,
match_args: bool = ...,
kw_only: bool = ...,
slots: bool = ...,
weakref_slot: bool = ...,
) -> Callable[[type[_T]], type[_T]]: ...
elif sys.version_info >= (3, 10):
@overload
def dataclass(
*,