Visitar URL original
gh-90562: Mention slots pitfall in dataclass docs by thejcannon 路 Pull Request #107391 路 python/cpython 路 GitHub
Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update dataclasses.rst
  • Loading branch information
thejcannon authored Jul 28, 2023
commit 91bbbd2b08ff6c7ea3550615bfa96710ca4ccdcc
2 changes: 1 addition & 1 deletion Doc/library/dataclasses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Module contents
will be generated and new class will be returned instead of the original one.
If :attr:`~object.__slots__` is already defined in the class, then :exc:`TypeError`
is raised. Calling no-arg `super()` in dataclasses using `slots=True` will result in
the following Exception being raised:
the following Exception being raised:
Comment thread
hugovk marked this conversation as resolved.
Outdated
`TypeError: super(type, obj): obj must be an instance or subtype of type`.
The two-arg `super()` is a valid workaround. See :issue:`46404` for full details.

Expand Down