PEP 218 Re: ANN: set-0.1 module available

Denis S. Otkidach ods at fep.ru
Thu May 16 11:44:18 EDT 2002


On Thu, 16 May 2002, Roman Suzi wrote:

RS> >It's listed as deferred (and its not mentioned in Guido's
RS> PEP
RS> >parade).
RS> >Maybe it needs a new champion?
RS>
RS> Hmmm... What do you mean? Set functionality is being asked
RS> every day
RS> (for example, sorted list vs. dictionary thread).
RS> Implementation
RS> (as I understand) is there. Why does Guido have any
RS> objections?

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.  Solution in kjSet is certanly bad,
look at the example below:

# s is set and d is dictionary
if d.has_key(s):
    # do smth.
else:
    # modify s -- this will raise exception

Here s _is not_ in dictionary but nevertheless is frozen. This
will confuse users that know nothing about set _implementation_.
Taking into account that very most users don't know about hashing
at all, such implementation is suitable only for third party
modules but not for Python builtin type.






More information about the Python-list mailing list