set using alternative hash function?

Austin Bingham austin.bingham at gmail.com
Fri Oct 16 06:36:51 CEST 2009


On Thu, Oct 15, 2009 at 7:49 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
> Austin Bingham wrote:
> I'm feeling really dense about now... What am I missing?

What you're missing is the entire discussion up to this point. I was
looking for a way to use an alternative uniqueness criteria in a set
instance without needing to modify my class.

> So is that the behavior you're wanting, keeping the first object and
> discarding all others?  Or is there something else I'm still missing?

Yes and yes. I want "normal" set behavior, but I want the set to use
user-provided hash and equality tests, i.e. ones that don't
necessarily call __hash__ and __eq__ on the candidate elements.

Austin



More information about the Python-list mailing list