FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-115775: Add whatsnew entry about __static_attributes__ by iritkatriel · Pull Request #117909 · python/cpython · GitHub

/ cpython Public
7 changes: 7 additions & 0 deletions Doc/library/stdtypes.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -5542,6 +5542,13 @@ types, where they are relevant. Some of these are not reported by the
[<class 'bool'>, <enum 'IntEnum'>, <flag 'IntFlag'>, <class 're._constants._NamedIntConstant'>]


.. attribute:: class.__static_attributes__

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

.. versionadded:: 3.13

.. _int_max_str_digits:

Integer string conversion length limitation
Expand Down
5 changes: 5 additions & 0 deletions Doc/reference/datamodel.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,7 @@ A class object can be called (see above) to yield a class instance (see below).
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 @@ Special attributes:
A tuple containing the :ref:`type parameters <type-params>` of
a :ref:`generic class <generic-classes>`.

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

Comment thread
iritkatriel marked this conversation as resolved.

Class instances
---------------
Expand Down
5 changes: 5 additions & 0 deletions Doc/whatsnew/3.13.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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 :attr:`~class.__static_attributes__` attribute, populated by the compiler,
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

Back | FazBrowse Home | New Git URL