[docs] [issue30292] Why is there a concept "unbound method" in <Descriptor HowTo Guide> python3 version?

debuggy report at bugs.python.org
Sat May 6 09:05:43 EDT 2017


New submission from debuggy:

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

----------
assignee: docs at python
components: Documentation
messages: 293160
nosy: debuggy, docs at python
priority: normal
severity: normal
status: open
title: Why is there a concept "unbound method" in <Descriptor HowTo Guide> python3 version?
type: enhancement
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30292>
_______________________________________


More information about the docs mailing list