set using alternative hash function?

Austin Bingham austin.bingham at gmail.com
Thu Oct 15 16:42:20 CEST 2009


On Thu, Oct 15, 2009 at 4:06 PM, Anthony Tolle <anthony.tolle at gmail.com> wrote:
> Why not use a dict?  The key would be the object name.  Pretty much
> the same behavior as a set (via the key), and you can still easily
> iterate over the objects.

To reiterate, dict only gets me part of what I want. Whereas a set
with uniqueness defined over 'obj.name' would guarantee no name
collisions, dict only sorta helps me keep things straight; it doesn't
actually enforce that my values have unique names.

Austin



More information about the Python-list mailing list