"Delaney, Timothy C (Timothy)" <[EMAIL PROTECTED]> writes:

> Set: Items are iterated over in the order that they are added. Adding an
> item that compares equal to one that is already in the set does not
> replace the item already in the set, and does not change the iteration
> order. Removing an item, then re-adding it moves the item to the end of
> the iteration order.

Well, this could be satisfied by an append_new operation on lists,
right (thinking of Common Lisps #'cl:pushnew)?  Complexity not that
great, of course, but I've written code like:

if a not in l:
    l.append(a)

and not suffered that badly for it before now...

> Dict: Keys are iterated over in the order that they are added. Setting a
> value using a key that compares equal to one already in the dict
> replaces the value, but not the key, and does not change the iteration
> order. Removing a key (and value) then re-adding it moves the key to the
> end of the iteration order.

And these are what CL types call association lists, in effect.

Cheers,
mwh

-- 
  #ifndef P_tmpdir
  printf( "Go buy a better computer" );
  exit( ETHESKYISFALLINGANDIWANTMYMAMA );
                         -- Dimitri Maziuk on writing secure code, asr
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to