diff options
| author | Yury Selivanov <yselivanov@sprymix.com> | 2014-04-08 12:03:07 -0400 |
|---|---|---|
| committer | Yury Selivanov <yselivanov@sprymix.com> | 2014-04-08 12:03:07 -0400 |
| commit | d3f918ca44f98683a8d0394a3610452303ceb3fd (patch) | |
| tree | f0ed71397fbf916ad8157b1242e89d5924d3d7fb | |
| parent | 0fceaf45e2f6695685785e18852902740210a128 (diff) | |
| download | cpython-git-d3f918ca44f98683a8d0394a3610452303ceb3fd.tar.gz | |
docs: Document __objclass__. Closes #19281.
Initial patch by Nick Coghlan
| -rw-r--r-- | Doc/reference/datamodel.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 8204dc3dcd..a78b222a28 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -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 |
