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 2011年03月28日 21:34 by alex, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg132425 - (view) | Author: Alex Gaynor (alex) * (Python committer) | Date: 2011年03月28日 21:34 | |
This is related to the discussion we had at the PyCon language summit about C vs Python function binding. If you create a partial instance and put it on a class it doesn't create bound instances. This behavior is a tad surprising in my view. At a minimum it'd be nice if the docs mentioned this. |
|||
| msg132435 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2011年03月28日 22:27 | |
True, this could be documented better - flagging as a docs bug. (It is mentioned at the bottom of http://docs.python.org/library/functools.html#partial-objects, but that could be referenced better from the main documentation of the function higher up in the page) There's actually more to it than just an oversight though - partial() fills in positional arguments from the left, so using one as a method would require specification of a carefully crafted selection of positional and keyword arguments to ensure the instance was bound and passed in at the right point. |
|||
| msg132438 - (view) | Author: Alex Gaynor (alex) * (Python committer) | Date: 2011年03月28日 22:29 | |
Indeed I completely missed the section at the bottom. A note in the above section would be a useful addition. |
|||
| msg215169 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2014年03月30日 06:00 | |
With the introduction of functools.partialmethod in 3.4, marking this older docs issue as a "won't fix" |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:15 | admin | set | github: 55913 |
| 2014年03月30日 06:00:26 | ncoghlan | set | status: open -> closed type: enhancement messages: + msg215169 resolution: wont fix stage: resolved |
| 2011年03月28日 22:29:52 | alex | set | messages: + msg132438 |
| 2011年03月28日 22:27:46 | ncoghlan | set | nosy:
+ docs@python, ncoghlan messages: + msg132435 assignee: docs@python components: + Documentation |
| 2011年03月28日 21:34:11 | alex | create | |