PEP 218 Re: ANN: set-0.1 module available

James J. Besemer jb at cascade-sys.com
Fri May 17 17:42:00 EDT 2002


Erik Max Francis wrote:

> "Denis S. Otkidach" wrote:
>
> ? There are still unresolved issues.  E.g. should set object be
> ? hashable?  Somebody wish sets of sets or set as dict key that
> ? require set to be hashable.
>
> I would say yes, a set should require an immutable object, for the same
> reason that a dictionary key should.  You couldn't have dictionaries
> themselves as dictionary keys, and nobody seems to have a problem with
> that.

Actually Denis seemed to be suggesting that sets themselves should be
immutable so they could Serve as dictionary keys.  I think it's very
plausable that sets would be used in this manner..

> I'm envisioning an implementation which behaves much like a dictionary,
> with the elements of the set as keys, and with dummy values.  What's
> wrong with that?

So long as the result would be immutable and usable as a dictionary key it
would probably work ok.

--jb

>

--
James J. Besemer  503-280-0838 voice
http://cascade-sys.com  503-280-0375 fax
mailto:jb at cascade-sys.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20020517/217d266f/attachment.html>


More information about the Python-list mailing list