Skip to content

Commit b219e55

Browse files
authored
Correct DynamicClassAttribute from function to class in types docs (GH-144968)
Also: add sphinx roles to the text
1 parent f5ec90d commit b219e55

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
@@ -515,14 +515,14 @@ Additional Utility Classes and Functions
515515
.. versionchanged:: 3.13
516516
Added support for an optional positional argument.
517517

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

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

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

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

0 commit comments

Comments
 (0)