Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/library/dataclasses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ Module contents

To create a shallow copy, the following workaround may be used::

dict((field.name, getattr(obj, field.name)) for field in fields(obj))
{field.name: getattr(obj, field.name) for field in fields(obj)}

:func:`!asdict` raises :exc:`TypeError` if ``obj`` is not a dataclass
instance.
Expand Down