7 May
2010
7 May
'10
10:16 p.m.
On Fri, May 7, 2010 at 11:02 AM, Antoine Pitrou
VanL
writes: .. While I was at it, I also added a nice repr. Would this group be interested in a patch, or is this not interesting?
It would be more useful to provide equality, hashing and repr to partial itself, rather than a subclass. Feel free to propose a patch :)
While you are at it, you might want to take a look at http://bugs.python.org/issue7830, "Flatten nested functools.partial." For your purposes you will need to decide whether partial(partial(f, 1), 2) and partial(f, 1, 2) compare equal or not. Most likely with the current implementation the answer will be "no," which may not be ideal.