[Python-Dev] Possible patch for functools partial - Interested?

Alexander Belopolsky alexander.belopolsky at gmail.com
Fri May 7 18:46:23 CEST 2010


On Fri, May 7, 2010 at 11:02 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> VanL <van.lindberg <at> gmail.com> 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.


More information about the Python-Dev mailing list