[issue4331] Add functools.partialmethod

alon horev report at bugs.python.org
Tue Oct 29 01:10:27 CET 2013


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:
1. I didn't use @wraps or copied attributes from the wrapped function  (__doc__, __dict__) to the partialmethod object. This is intentionally so partial and partialmethod would have similar semantics.
2. I've implemented a __repr__ although in all cases __get__ returns a partial object or bound method. I consider it nice for debugging when looking at an object's __dict__.

----------
Added file: http://bugs.python.org/file32405/4331.v1.patch

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


More information about the Python-bugs-list mailing list