Skip to content

Commit c9bf268

Browse files
[3.14] Correct DynamicClassAttribute from function to class in types docs (GH-144968) (GH-162204)
Also: add sphinx roles to the text (cherry picked from commit b219e55) Co-authored-by: Tan Long <tanloong@foxmail.com>
1 parent 7ede29a commit c9bf268

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎Doc/library/types.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,14 +489,14 @@ Additional Utility Classes and Functions
489489
.. versionchanged:: 3.13
490490
Added support for an optional positional argument.
491491

492-
.. function:: DynamicClassAttribute(fget=None, fset=None, fdel=None, doc=None)
492+
.. class:: DynamicClassAttribute(fget=None, fset=None, fdel=None, doc=None)
493493

494-
Route attribute access on a class to __getattr__.
494+
Route attribute access on a class to :meth:`~object.__getattr__`.
495495

496496
This is a descriptor, used to define attributes that act differently when
497497
accessed through an instance and through a class. Instance access remains
498498
normal, but access to an attribute through a class will be routed to the
499-
class's __getattr__ method; this is done by raising AttributeError.
499+
class's ``__getattr__`` method; this is done by raising :exc:`AttributeError`.
500500

501501
This allows one to have properties active on an instance, and have virtual
502502
attributes on the class with the same name (see :class:`enum.Enum` for an example).

0 commit comments

Comments
 (0)