Skip to content

Commit a2e8a05

Browse files
author
v01dxyz
committed
gh-145369: document dataclass could possibly mutate provided field objects (#145369)
1 parent 0598f4a commit a2e8a05

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Doc/library/dataclasses.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@ Module contents
254254
used because ``None`` is a valid value for some parameters with
255255
a distinct meaning. No code should directly use the :const:`MISSING` value.
256256

257+
:deco:`dataclass` is free to possibly mutate the provided field
258+
objects. As such, do not use the same object for multiple fields
259+
even if they share the same properties. If so, the updated class is
260+
not ensured to be well-functioning.
261+
257262
The parameters to :func:`!field` are:
258263

259264
- *default*: If provided, this will be the default value for this

0 commit comments

Comments
 (0)