Skip to content
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

gh-115775: Add whatsnew entry about __static_attributes__ #117909

Merged
merged 12 commits into from
Apr 19, 2024
5 changes: 5 additions & 0 deletions Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,7 @@
single: __doc__ (class attribute)
single: __annotations__ (class attribute)
single: __type_params__ (class attribute)
single: __static_attributes__ (class attribute)

Special attributes:

Expand Down Expand Up @@ -1000,6 +1001,10 @@
A tuple containing the :ref:`type parameters <type-params>` of
a :ref:`generic class <generic-classes>`.

:attr:`__static_attributes__`
A tuple containing names of attributes of this class which are accessed
through ``self.X`` from any function in its body.

Check warning on line 1007 in Doc/reference/datamodel.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:attr reference target not found: __static_attributes__
iritkatriel marked this conversation as resolved.
Show resolved Hide resolved

Class instances
---------------
Expand Down
5 changes: 5 additions & 0 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ Improved Error Messages
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
TypeError: split() got an unexpected keyword argument 'max_split'. Did you mean 'maxsplit'?

* Classes have a new ``__static_attributes__`` attribute, populated by the compiler,
iritkatriel marked this conversation as resolved.
Show resolved Hide resolved
with a tuple of names of attributes of this class which are accessed
through ``self.X`` from any function in its body. (Contributed by Irit Katriel
in :gh:`115775`.)

Incremental Garbage Collection
------------------------------

Expand Down