This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Johannes Lade
Recipients Johannes Lade, docs@python, ezio.melotti, gregory.p.smith, martin.panter, pfalcon, rhettinger, steven.daprano
Date 2017-08-04.11:41:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1501846874.37.0.831716987005.issue23702@psf.upfronthosting.co.za>
In-reply-to
Content
This is still a problem. Can please somebody fix this? There are already enough confusing discussion full of wrong information about this topic, so it would be nice if the official documentation would get it right. Also there's multiple Issues for this. Can they be combined into one?
Just one example I found: on https://docs.python.org/3.5/howto/descriptor.html#functions-and-methods

Documentation:
>>> class D(object):
...     def f(self, x):
...         return x
...
>>> d = D()
>>> D.__dict__['f']  # Stored internally as a function
<function f at 0x00C45070>
>>> D.f              # Get from a class becomes an unbound method
<unbound method D.f>
>>> d.f              # Get from an instance becomes a bound method
<bound method D.f of <__main__.D object at 0x00B18C90>>

ipython3.5.3
In [1]: class D(object):
   ...: ...     def f(self, x):
   ...: ...         return x
   ...: ...

In [2]: d = D()

In [3]: D.__dict__['f']  # Stored internally as a function
Out[3]: <function __main__.D.f>

In [4]: D.f              # Get from a class becomes an unbound method
Out[4]: <function __main__.D.f>

In [5]: d.f              # Get from an instance becomes a bound method
Out[5]: <bound method D.f of <__main__.D object at 0x7f4e2e278c18>>
History
Date User Action Args
2017-08-04 11:41:14Johannes Ladesetrecipients: + Johannes Lade, rhettinger, pfalcon, gregory.p.smith, ezio.melotti, steven.daprano, docs@python, martin.panter
2017-08-04 11:41:14Johannes Ladesetmessageid: <1501846874.37.0.831716987005.issue23702@psf.upfronthosting.co.za>
2017-08-04 11:41:14Johannes Ladelinkissue23702 messages
2017-08-04 11:41:13Johannes Ladecreate