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.

classification
Title: Why is there a concept "unbound method" in python3 version?
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder: docs.python.org/3/howto/descriptor.html still refers to "unbound methods"
View: 23702
Assigned To: docs@python Nosy List: debuggy, docs@python
Priority: normal Keywords:

Created on 2017-05-06 13:05 by debuggy, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (1)
msg293160 - (view) Author: debuggy (debuggy) Date: 2017-05-06 13:05
When I read <Descriptor HowTo Guide> (python 3.6.1 version), I found there is a concept of 'unbound method' in some places. However, when I referred to <What’s New In Python 3.0>, it said the concept of “unbound methods” has been removed from the language.

So I wondered if there should be a change in <Descriptor HowTo Guide> python3 version?

For instance, in this code example of the guide:

>>> 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>>

When I tested myself, the result of statement "D.f" should be <function> not <unbound method>.
History
Date User Action Args
2022-04-11 14:58:46adminsetgithub: 74478
2017-05-06 14:20:15martin.pantersetstatus: open -> closed
superseder: docs.python.org/3/howto/descriptor.html still refers to "unbound methods"
resolution: duplicate
stage: resolved
2017-05-06 13:05:43debuggycreate