diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2014-04-08 16:04:04 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2014-04-08 16:04:04 (GMT) |
commit | b9aa8cb0c7fe20472627312b713dd426ea4228cf (patch) | |
tree | a7e164c252d380e8327b4e8fd8eac5fec6e52412 /Doc/reference | |
parent | 67ae50ee1c723db3a0d9fb22fc182dc1854fb137 (diff) | |
download | cpython-b9aa8cb0c7fe20472627312b713dd426ea4228cf.zip cpython-b9aa8cb0c7fe20472627312b713dd426ea4228cf.tar.gz cpython-b9aa8cb0c7fe20472627312b713dd426ea4228cf.tar.bz2 |
docs: Document __objclass__. Closes #19281.
Initial patch by Nick Coghlan
Diffstat (limited to 'Doc/reference')
-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 8204dc3..a78b222 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 |