[Python-checkins] r61708 - in python/trunk/Doc: library/inspect.rst reference/datamodel.rst
georg.brandl
python-checkins at python.org
Fri Mar 21 20:20:22 CET 2008
Author: georg.brandl
Date: Fri Mar 21 20:20:21 2008
New Revision: 61708
Modified:
python/trunk/Doc/library/inspect.rst
python/trunk/Doc/reference/datamodel.rst
Log:
Add docs for __func__ and __self__ on methods.
Modified: python/trunk/Doc/library/inspect.rst
==============================================================================
--- python/trunk/Doc/library/inspect.rst (original)
+++ python/trunk/Doc/library/inspect.rst Fri Mar 21 20:20:21 2008
@@ -54,12 +54,12 @@
| | im_class | class object that asked | \(1) |
| | | for this method | |
+-----------+-----------------+---------------------------+-------+
-| | im_func | function object | |
-| | | containing implementation | |
+| | im_func or | function object | |
+| | __func__ | containing implementation | |
| | | of method | |
+-----------+-----------------+---------------------------+-------+
-| | im_self | instance to which this | |
-| | | method is bound, or | |
+| | im_self or | instance to which this | |
+| | __self__ | method is bound, or | |
| | | ``None`` | |
+-----------+-----------------+---------------------------+-------+
| function | __doc__ | documentation string | |
Modified: python/trunk/Doc/reference/datamodel.rst
==============================================================================
--- python/trunk/Doc/reference/datamodel.rst (original)
+++ python/trunk/Doc/reference/datamodel.rst Fri Mar 21 20:20:21 2008
@@ -555,6 +555,10 @@
.. versionchanged:: 2.2
:attr:`im_self` used to refer to the class that defined the method.
+ .. versionchanged:: 2.6
+ For 3.0 forward-compatibility, :attr:`im_func` is also available as
+ :attr:`__func__`, and :attr:`im_self` as :attr:`__self__`.
+
.. index::
single: __doc__ (method attribute)
single: __name__ (method attribute)
More information about the Python-checkins
mailing list