mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
docs: Document __objclass__. Closes #19281.
Initial patch by Nick Coghlan
This commit is contained in:
parent
0fceaf45e2
commit
d3f918ca44
1 changed files with 8 additions and 0 deletions
|
|
@ -1467,6 +1467,14 @@ class' :attr:`__dict__`.
|
|||
Called to delete the attribute on an instance *instance* of the owner class.
|
||||
|
||||
|
||||
The :attr:`__objclass__` is interpreted by the :mod:`inspect` module as
|
||||
specifying the class where this object was defined (setting this appropriately
|
||||
can assist in runtime introspection of dynamic class attributes). For callables,
|
||||
it may indicate that an instance of the given type (or a subclass) is expected
|
||||
or required as the first positional argument (for example, CPython sets this
|
||||
attribute for unbound methods that are implemented in C).
|
||||
|
||||
|
||||
.. _descriptor-invocation:
|
||||
|
||||
Invoking Descriptors
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue