Skip to content

Commit a5eabc9

Browse files
bpo-43997: Add versionadded directives for to match_args, kw_only, and slots in dataclasses.dataclasses documentation (GH-25803)
1 parent d8389e3 commit a5eabc9

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Doc/library/dataclasses.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ Module-level decorators, classes, and functions
168168
``__match_args__`` is already defined in the class, then
169169
``__match_args__`` will not be generated.
170170

171+
.. versionadded:: 3.10
172+
171173
- ``kw_only``: If true (the default value is ``False``), then all
172174
fields will be marked as keyword-only. If a field is marked as
173175
keyword-only, then the only affect is that the :meth:`__init__`
@@ -177,11 +179,15 @@ Module-level decorators, classes, and functions
177179
:term:`parameter` glossary entry for details. Also see the
178180
``dataclasses.KW_ONLY`` section.
179181

182+
.. versionadded:: 3.10
183+
180184
- ``slots``: If true (the default is ``False``), :attr:`__slots__` attribute
181185
will be generated and new class will be returned instead of the original one.
182186
If :attr:`__slots__` is already defined in the class, then :exc:`TypeError`
183187
is raised.
184188

189+
.. versionadded:: 3.10
190+
185191
``field``\s may optionally specify a default value, using normal
186192
Python syntax::
187193

@@ -267,6 +273,8 @@ Module-level decorators, classes, and functions
267273
This is used when the generated :meth:`__init__` method's
268274
parameters are computed.
269275

276+
.. versionadded:: 3.10
277+
270278
If the default value of a field is specified by a call to
271279
:func:`field()`, then the class attribute for this field will be
272280
replaced by the specified ``default`` value. If no ``default`` is

0 commit comments

Comments
 (0)