This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author erickt
Recipients erickt
Date 2008-08-16.07:05:09
SpamBayes Score 1.9227644e-05
Marked as misclassified No
Message-id <1218870311.31.0.296416489838.issue3564@psf.upfronthosting.co.za>
In-reply-to
Content
functools.partial functions are not comparable, in both python 2.5 and 
3.0:

>>> def foo(): pass
>>> functools.partial(foo) == functools.partial(foo)
False

It can be worked around by comparing the func, args, and keywords, but 
this means that if a partial function is stored in some structure, such 
as:

>>> def foo(): pass
>>> f1=functools.partial(foo)
>>> f2=functools.partial(foo)
>>> (1,'a',f1) == (1,'a',f2)
False

Which complicates things when I'm comparing things in a function that 
works with generic data structures. Would it be possible to extend 
partial to support comparisons?
History
Date User Action Args
2008-08-16 07:05:11ericktsetrecipients: + erickt
2008-08-16 07:05:11ericktsetmessageid: <1218870311.31.0.296416489838.issue3564@psf.upfronthosting.co.za>
2008-08-16 07:05:10ericktlinkissue3564 messages
2008-08-16 07:05:09ericktcreate