Skip to content
Prev Previous commit
Next Next commit
Double trouble
  • Loading branch information
thejcannon authored Jul 28, 2023
commit 08903c5bd29c8e65c0c8568c1c4a4bc810d0711c
6 changes: 3 additions & 3 deletions Doc/library/dataclasses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +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. Calling no-arg `super()` in dataclasses using `slots=True` will result in
is raised. Calling no-arg ``super()`` in dataclasses using ``slots=True`` will result in
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.
``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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should try to capture everything relevant in the documentation -- what is relevant to the reader from the linked issue that isn't captured in your summary?

A

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these two points are it. What to look for and how to workaround.

Comment thread
thejcannon marked this conversation as resolved.
Outdated

.. versionadded:: 3.10

Expand Down