[issue4331] Add functools.partialmethod

2013-11-04 Thread Nick Coghlan
Nick Coghlan added the comment: Indeed, added to __all__ in http://hg.python.org/cpython/rev/ac1685661b07 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4331 ___

[issue4331] Add functools.partialmethod

2013-11-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset 46d3c5539981 by Nick Coghlan in branch 'default': Issue #4331: Added functools.partialmethod http://hg.python.org/cpython/rev/46d3c5539981 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org

[issue4331] Add functools.partialmethod

2013-11-03 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- resolution: - fixed stage: commit review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4331 ___

[issue4331] Add functools.partialmethod

2013-11-03 Thread Vajrasky Kok
Vajrasky Kok added the comment: Should we add partialmethod to __all__ for consistency? -- nosy: +vajrasky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4331 ___

[issue4331] Add functools.partialmethod

2013-10-31 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- stage: needs patch - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4331 ___ ___

[issue4331] Add functools.partialmethod

2013-10-31 Thread Matt Joiner
Changes by Matt Joiner anacro...@gmail.com: -- nosy: -anacrolix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4331 ___ ___ Python-bugs-list

[issue4331] Add functools.partialmethod

2013-10-31 Thread Nick Coghlan
Nick Coghlan added the comment: Updated patch based on Alon's last patch. The major functional change is to ensure __self__ is set appropriately on any bound methods returned by the descriptor. I also updated the docs and docstring, and added a What's New entry (as well as rewording the

[issue4331] Add functools.partialmethod

2013-10-29 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- assignee: - ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4331 ___ ___ Python-bugs-list

[issue4331] Add functools.partialmethod

2013-10-29 Thread alon horev
alon horev added the comment: I've changed the test according to the code review. Thanks -- Added file: http://bugs.python.org/file32409/4331.v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4331

[issue4331] Add functools.partialmethod

2013-10-28 Thread alon horev
alon horev added the comment: Adding a patch with tests and documentation. Please feel free to comment on anything: my English, coding/testing style. I'm pretty sure the documentation can be better but it turns out I speak better Python than English. Two decisions I've made and unsure of:

[issue4331] Add functools.partialmethod

2013-10-27 Thread alon horev
alon horev added the comment: I think the following test demonstrates the API we're looking for. 1. Am I missing any functionality? 2. How does partialmethod relate to @absolutemethod? from functools import partial class partialmethod(object): def __init__(self, func, *args, **keywords):

[issue4331] Add functools.partialmethod

2013-10-27 Thread Nick Coghlan
Nick Coghlan added the comment: On 27 Oct 2013 22:17, alon horev rep...@bugs.python.org wrote: alon horev added the comment: I think the following test demonstrates the API we're looking for. 1. Am I missing any functionality? The keyword arg handling is backwards for unbound methods (the

[issue4331] Add functools.partialmethod

2013-10-26 Thread alon horev
alon horev added the comment: Here's another attempt at a consistent api with regular methods. I'm contemplating whether partialmethod should support __call__. Given the fact partial is used to bind positional arguments, it will do the 'wrong' thing when calling the partialmethod directly and

[issue4331] Add functools.partialmethod

2013-10-26 Thread Nick Coghlan
Nick Coghlan added the comment: I like your suggestion of not providing __call__(), as I don't see a way to make it work with arbitrary underlying descriptors, and neither classmethod nor staticmethod is callable. In terms of usage, I think this approach will be OK, as in practice I expect

[issue4331] Add functools.partialmethod

2013-10-25 Thread alon horev
alon horev added the comment: I just want to make sure I understand the semantics concerning class methods, the following example demonstrates a usage similar to regular methods as much as possible: class A(object): def add(self, x, y): print(self) return x + y add10 =

[issue4331] Add functools.partialmethod

2013-10-25 Thread Nick Coghlan
Nick Coghlan added the comment: On 26 Oct 2013 05:28, alon horev rep...@bugs.python.org wrote: Is the first option what you had in mind? That's actually an interesting question. I was going to say yes, but then I realised it would be better to just do the right thing when the underlying object

[issue4331] Add functools.partialmethod

2013-10-24 Thread Nick Coghlan
Nick Coghlan added the comment: To clarify the current state of this: - I'm still in favour of adding this feature for Python 3.4 - a suitable patch is still needed, as the currently attached patches modify the existing functools.partial object, rather than adding a separate partialmethod API

[issue4331] Add functools.partialmethod

2013-06-05 Thread Nick Coghlan
Nick Coghlan added the comment: Any associated tests may also want check that wrapping classmethod around a partialmethod generates a well behaved class method, and ditto for property. If singledispath, classmethod, partialmethod and class and instance attribute access all work correctly,

[issue4331] Add functools.partialmethod

2013-06-05 Thread Matt Joiner
Matt Joiner added the comment: This sounds excellent Nick. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4331 ___ ___ Python-bugs-list mailing

[issue4331] Add functools.partialmethod

2013-06-04 Thread Nick Coghlan
Nick Coghlan added the comment: I don't believe it is reasonable to change the behaviour of partial at this late stage of the game. It's documented as behaving like staticmethod (albeit by not implementing the descriptor protocol at all), so that's no longer something we can change. If issue