Skip to content
Closed
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
Apply suggestions from code review
Co-authored-by: Petr Viktorin <encukou@gmail.com>
  • Loading branch information
serhiy-storchaka and encukou authored Nov 17, 2025
commit 584637981cc42a962bf54ae1b9f6d9a9ba4a31dc
8 changes: 4 additions & 4 deletions Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2632,9 +2632,10 @@ Notes on using *__slots__*:

* :exc:`TypeError` will be raised if *__slots__* other than *__dict__* and
*__weakref__* are defined for a class derived from a
:c:member:`"variable-length" built-in type <PyTypeObject.tp_itemsize>`
without the :c:macro:`Py_TPFLAGS_ITEMS_AT_END` flag such as
:class:`int`, :class:`bytes`, and :class:`tuple`.
:c:member:`"variable-length" built-in type <PyTypeObject.tp_itemsize>`,
unless the C type is defined with :c:macro:`Py_TPFLAGS_ITEMS_AT_END`.
For example, *__slots__* other than *__dict__* and *__weakref__* cannot
be defined on subclasses of :class:`int`, :class:`bytes`, or :class:`tuple`.
Comment on lines +2637 to +2638

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Maybe use "they"?

Suggested change
For example, *__slots__* other than *__dict__* and *__weakref__* cannot
be defined on subclasses of :class:`int`, :class:`bytes`, or :class:`tuple`.
For example, they cannot be defined on subclasses of
:class:`int`, :class:`bytes`, or :class:`tuple`.


* Any non-string :term:`iterable` may be assigned to *__slots__*.

Expand All @@ -2659,7 +2660,6 @@ Notes on using *__slots__*:

.. versionchanged:: next
Allowed defining the *__dict__* and *__weakref__* *__slots__* for any class.

Allowed defining any *__slots__* for a class derived from :class:`type` or
other :c:member:`"variable-length" built-in type <PyTypeObject.tp_itemsize>`
with the :c:macro:`Py_TPFLAGS_ITEMS_AT_END` flag.
Expand Down
Loading