Skip to content

Commit ef878e9

Browse files
authored
Add weakref_slot parameter to @dataclass decorator (#7772)
python/cpython#92160
1 parent 4bcb1a9 commit ef878e9

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

stdlib/dataclasses.pyi

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,23 @@ else:
7979
@overload
8080
def dataclass(_cls: None) -> Callable[[type[_T]], type[_T]]: ...
8181

82-
if sys.version_info >= (3, 10):
82+
if sys.version_info >= (3, 11):
83+
@overload
84+
def dataclass(
85+
*,
86+
init: bool = ...,
87+
repr: bool = ...,
88+
eq: bool = ...,
89+
order: bool = ...,
90+
unsafe_hash: bool = ...,
91+
frozen: bool = ...,
92+
match_args: bool = ...,
93+
kw_only: bool = ...,
94+
slots: bool = ...,
95+
weakref_slot: bool = ...,
96+
) -> Callable[[type[_T]], type[_T]]: ...
97+
98+
elif sys.version_info >= (3, 10):
8399
@overload
84100
def dataclass(
85101
*,

0 commit comments

Comments
 (0)