Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e7cce2a commit f303651Copy full SHA for f303651
1 file changed
Doc/library/dataclasses.rst
@@ -362,7 +362,7 @@ Module contents
362
363
To create a shallow copy, the following workaround may be used::
364
365
- dict((field.name, getattr(obj, field.name)) for field in fields(obj))
+ {field.name: getattr(obj, field.name) for field in fields(obj)}
366
367
:func:`!asdict` raises :exc:`TypeError` if ``obj`` is not a dataclass
368
instance.
0 commit comments