@@ -46,7 +46,7 @@ directly specified in the ``InventoryItem`` definition shown above.
4646Module contents
4747---------------
4848
49- ..decorator ::dataclass(*, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False, match_args=True, kw_only=False, slots=False)
49+ ..decorator ::dataclass(*, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False, match_args=True, kw_only=False, slots=False, weakref_slot=False )
5050
5151 This function is a:term: `decorator ` that is used to add generated
5252:term: `special method `\s to classes, as described below.
@@ -79,7 +79,7 @@ Module contents
7979 class C:
8080 ...
8181
82- @dataclass(init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False, match_args=True, kw_only=False, slots=False)
82+ @dataclass(init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False, match_args=True, kw_only=False, slots=False, weakref_slot=False )
8383 class C:
8484 ...
8585
@@ -198,6 +198,13 @@ Module contents
198198 base class ``__slots__ `` may be any iterable, but *not * an iterator.
199199
200200
201+ - ``weakref_slot ``: If true (the default is ``False ``), add a slot
202+ named "__weakref__", which is required to make an instance
203+ weakref-able. It is an error to specify ``weakref_slot=True ``
204+ without also specifying ``slots=True ``.
205+
206+ ..versionadded ::3.11
207+
201208 ``field ``\s may optionally specify a default value, using normal
202209 Python syntax::
203210
@@ -381,7 +388,7 @@ Module contents
381388:func: `astuple ` raises:exc: `TypeError ` if ``obj `` is not a dataclass
382389 instance.
383390
384- ..function ::make_dataclass(cls_name, fields, *, bases=(), namespace=None, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False, match_args=True, kw_only=False, slots=False)
391+ ..function ::make_dataclass(cls_name, fields, *, bases=(), namespace=None, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False, match_args=True, kw_only=False, slots=False, weakref_slot=False )
385392
386393 Creates a new dataclass with name ``cls_name ``, fields as defined
387394 in ``fields ``, base classes as given in ``bases ``, and initialized
@@ -390,8 +397,8 @@ Module contents
390397 or ``(name, type, Field) ``. If just ``name `` is supplied,
391398 ``typing.Any `` is used for ``type ``. The values of ``init ``,
392399 ``repr ``, ``eq ``, ``order ``, ``unsafe_hash ``, ``frozen ``,
393- ``match_args ``, ``kw_only ``,and ``slots `` have the same meaning as
394- they do in:func: `dataclass `.
400+ ``match_args ``, ``kw_only ``, ``slots ``, and `` weakref_slot `` have
401+ the same meaning as they do in:func: `dataclass `.
395402
396403 This function is not strictly required, because any Python
397404 mechanism for creating a new class with ``__annotations__ `` can