[issue4331] Add functools.partialmethod

Nick Coghlan report at bugs.python.org
Sat Oct 26 03:57:43 CEST 2013


Nick Coghlan added the comment:

On 26 Oct 2013 05:28, "alon horev" <report at 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 was a classmethod descriptor, rather than composing them
the other way around.

That view means we should be delegating __get__ to the underlying
descriptor and responding appropriately to the result. And for __call__ we
then can't play games at all, since what my sketch does would be wrong when
wrapping staticmethod.

We also need to make sure the descriptor does the right thing when
@abstractmethod is involved.

----------

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


More information about the Python-bugs-list mailing list