Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8a01fd7

Browse files
iritkatrielEclips4encukouJelleZijlstra
authored
gh-115775: Add whatsnew entry about __static_attributes__ (GH-117909)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>Co-authored-by: Petr Viktorin <encukou@gmail.com>Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
1 parent5d54436 commit8a01fd7

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

‎Doc/library/stdtypes.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5542,6 +5542,13 @@ types, where they are relevant. Some of these are not reported by the
55425542
[<class 'bool'>, <enum 'IntEnum'>, <flag 'IntFlag'>, <class 're._constants._NamedIntConstant'>]
55435543

55445544

5545+
..attribute::class.__static_attributes__
5546+
5547+
A tuple containing names of attributes of this class which are accessed
5548+
through ``self.X`` from any function in its body.
5549+
5550+
..versionadded::3.13
5551+
55455552
.. _int_max_str_digits:
55465553

55475554
Integer string conversion length limitation

‎Doc/reference/datamodel.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,7 @@ A class object can be called (see above) to yield a class instance (see below).
970970
single: __doc__ (class attribute)
971971
single: __annotations__ (class attribute)
972972
single: __type_params__ (class attribute)
973+
single: __static_attributes__ (class attribute)
973974

974975
Special attributes:
975976

@@ -1000,6 +1001,10 @@ Special attributes:
10001001
A tuple containing the:ref:`type parameters<type-params>` of
10011002
a:ref:`generic class<generic-classes>`.
10021003

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

10041009
Class instances
10051010
---------------

‎Doc/whatsnew/3.13.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ Improved Error Messages
115115
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
116116
TypeError: split() got an unexpected keyword argument 'max_split'. Did you mean 'maxsplit'?
117117

118+
* Classes have a new:attr:`~class.__static_attributes__` attribute, populated by the compiler,
119+
with a tuple of names of attributes of this class which are accessed
120+
through ``self.X`` from any function in its body. (Contributed by Irit Katriel
121+
in:gh:`115775`.)
122+
118123
Incremental Garbage Collection
119124
------------------------------
120125

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp