Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-90562: Mention slots pitfall in dataclass docs #107391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 21, 2024
Next Next commit
Mention slots pitfall in dataclass docs
  • Loading branch information
thejcannon authored Jul 28, 2023
commit e40f5f901dc6b71ae4382dbe3b9f7b5384cf8a64
5 changes: 4 additions & 1 deletion 5 Doc/library/dataclasses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ Module contents
- ``slots``: If true (the default is ``False``), :attr:`~object.__slots__` attribute
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.
is raised. Calling no-arg `super()` in dataclasses using `slots=True` will result in
the following Exception being raised:
`TypeError: super(type, obj): obj must be an instance or subtype of type`.
See :issue:`46404` for full details.

.. versionadded:: 3.10

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.