Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Doc/library/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -489,14 +489,14 @@ Additional Utility Classes and Functions
.. versionchanged:: 3.13
Added support for an optional positional argument.

.. function:: DynamicClassAttribute(fget=None, fset=None, fdel=None, doc=None)
.. class:: DynamicClassAttribute(fget=None, fset=None, fdel=None, doc=None)

Route attribute access on a class to __getattr__.
Route attribute access on a class to :meth:`~object.__getattr__`.

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

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