diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-05-23 06:16:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-23 06:16:23 (GMT) |
commit | ddaed629f4724d74848907be21d5faede3b2be8d (patch) | |
tree | b2bc8d82570939a21d324ff7273a3761cef9a33b /Doc/library | |
parent | 0d5fe2c7b417856ec62e46339aa769bce8dd5f12 (diff) | |
download | cpython-ddaed629f4724d74848907be21d5faede3b2be8d.zip cpython-ddaed629f4724d74848907be21d5faede3b2be8d.tar.gz cpython-ddaed629f4724d74848907be21d5faede3b2be8d.tar.bz2 |
[3.12] gh-90562: Mention slots pitfall in dataclass docs (GH-107391) (#119351)
Co-authored-by: Josh Cannon <joshdcannon@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/dataclasses.rst | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst index 71fbd19..455019d 100644 --- a/Doc/library/dataclasses.rst +++ b/Doc/library/dataclasses.rst @@ -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:`!__slots__` is already defined in the class, then :exc:`TypeError` - is raised. + is raised. Calling no-arg :func:`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``. + The two-arg :func:`super` is a valid workaround. See :gh:`90562` for full details. .. versionadded:: 3.10 |