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.
Created on 2015年03月18日 19:48 by pfalcon, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 3739 | merged | rhettinger, 2017年09月24日 23:53 | |
| PR 3742 | merged | python-dev, 2017年09月25日 08:06 | |
| Messages (9) | |||
|---|---|---|---|
| msg238468 - (view) | Author: Paul Sokolovsky (pfalcon) * | Date: 2015年03月18日 19:48 | |
Under https://docs.python.org/3/howto/descriptor.html#functions-and-methods , there're several references to unbound methods (including in expected output from the interpreter). As known, unbound methods are gone in Python3, so seeing those are confusing. (I didn't sharply know that unbound methods are gone from Py3, so was pretty confused by the examples there, comparing them with actual output of Cpython 3.4). |
|||
| msg253167 - (view) | Author: Martin Panter (martin.panter) * (Python committer) | Date: 2015年10月19日 03:26 | |
Current patch for Issue 25435 addresses the code example. Changes to the text are also needed though. |
|||
| msg293220 - (view) | Author: Steven D'Aprano (steven.daprano) * (Python committer) | Date: 2017年05月08日 00:59 | |
Be careful with the documentation patch. Although unbound method as an object type is gone, unbound method as a concept is not. Conceptually, something like ``MyClass.spam`` is an unbound method: it is a method of the MyClass type, but bound to no instance. In Python 2 that concept was implemented by MethodType. In Python 3, the concept is implemented by FunctionType. While it is certainly true from one perspective that unbound methods are nothing but functions, it is nevertheless also sometimes useful to distinguish from "functions defined in a class" (methods) and "other functions". I think that nearly all Python programmers would be happy to call ``spam`` below: class MyClass: def spam(self, arg): ... a method, even though it is also/really a function. |
|||
| msg293221 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2017年05月08日 01:17 | |
I'll fix that up. I've already been working on revising the document. There are a number of updates needed (user-friendly intro, properties revised to show the setting methods, __set_name__, etc). |
|||
| msg299738 - (view) | Author: Johannes Lade (Johannes Lade) | Date: 2017年08月04日 11:41 | |
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>> |
|||
| msg299739 - (view) | Author: Johannes Lade (Johannes Lade) | Date: 2017年08月04日 11:44 | |
And sorry for my lousy manners. Of course I appreciate all the hard work you do! It's just frustrating when you get confused by doc. |
|||
| msg299753 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2017年08月04日 15:33 | |
We have a sprint in early September and I'll fix it then. |
|||
| msg302918 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2017年09月25日 08:05 | |
New changeset 0d4497b9cae7942b7f731a6f99a73985c3fb4630 by Raymond Hettinger in branch 'master': bpo-23702: Update Descriptor-HOWTO to reflect the removal of unbound methods (#3739) https://github.com/python/cpython/commit/0d4497b9cae7942b7f731a6f99a73985c3fb4630 |
|||
| msg302920 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2017年09月25日 08:11 | |
New changeset 73c915a5cd1cdd8775cf47b77fef7ca8fd42ad96 by Raymond Hettinger (Miss Islington (bot)) in branch '3.6': [3.6] bpo-23702: Update Descriptor-HOWTO to reflect the removal of unbound methods (GH-3739) (#3742) https://github.com/python/cpython/commit/73c915a5cd1cdd8775cf47b77fef7ca8fd42ad96 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:14 | admin | set | github: 67890 |
| 2017年09月25日 08:16:07 | rhettinger | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2017年09月25日 08:15:17 | rhettinger | set | dependencies: - Wrong function calls and referring to not removed concepts in descriptor HowTo (documentation) |
| 2017年09月25日 08:11:23 | rhettinger | set | messages: + msg302920 |
| 2017年09月25日 08:06:03 | python-dev | set | pull_requests: + pull_request3729 |
| 2017年09月25日 08:05:52 | rhettinger | set | messages: + msg302918 |
| 2017年09月24日 23:53:35 | rhettinger | set | keywords:
+ patch stage: needs patch -> patch review pull_requests: + pull_request3725 |
| 2017年08月04日 15:33:19 | rhettinger | set | messages: + msg299753 |
| 2017年08月04日 11:44:29 | Johannes Lade | set | messages: + msg299739 |
| 2017年08月04日 11:41:14 | Johannes Lade | set | nosy:
+ Johannes Lade messages: + msg299738 |
| 2017年05月08日 01:17:18 | rhettinger | set | priority: high -> normal nosy: + rhettinger messages: + msg293221 assignee: docs@python -> rhettinger |
| 2017年05月08日 00:59:10 | steven.daprano | set | nosy:
+ steven.daprano messages: + msg293220 |
| 2017年05月06日 14:20:15 | martin.panter | link | issue30292 superseder |
| 2016年08月25日 21:29:42 | gregory.p.smith | set | priority: normal -> high nosy: + gregory.p.smith |
| 2016年01月03日 09:58:39 | ezio.melotti | set | versions: + Python 3.5, Python 3.6, - Python 3.4 |
| 2015年10月19日 03:26:18 | martin.panter | set | nosy:
+ martin.panter dependencies: + Wrong function calls and referring to not removed concepts in descriptor HowTo (documentation) messages: + msg253167 |
| 2015年03月18日 20:28:03 | ezio.melotti | set | nosy:
+ ezio.melotti type: behavior stage: needs patch |
| 2015年03月18日 19:48:34 | pfalcon | create | |