Dictionary from list?

Aahz Maruch aahz at panix.com
Wed Oct 24 12:18:11 CEST 2001


In article <mailman.1003771893.15913.python-list at python.org>,
 <James_Althoff at i2.com> wrote:
>
>Since there was a stalemate on the pros and cons of
>overloading/confusing the dictionary constructor ... isn't this a
>reasonable place to take advantage of the new 2.2 class methods and
>provide:
>
>dictionary.newFromList([k,v,...])

That's what subclassing is for:

class MyNewDict(dictionary):
    ....

d = MyNewDict()
d.fillFromList([k,v,...])
-- 
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

Sieg heil!



More information about the Python-list mailing list