UserDict -> dict, reasons for migrating existing code

Discussion in 'Python' started by Andreas Kuntzagk, Jul 21, 2003.

  1. Hi,

    what would be the reasons to migrate existing code from the use of
    UserDict() to dict()? (UserString ...) What would be reasons against?
    Reasons I can think of:
    pro:
    - Speed Improvement because of a level of indirection less
    - UserDict can become deprecated

    con:
    - Code not working whith older python
    - cost of migrating large codebase

    Do you know other reasons?

    Andreas
     
    Andreas Kuntzagk, Jul 21, 2003
    #1
    1. Advertising

  2. Quoth Andreas Kuntzagk:
    [...]
    > what would be the reasons to migrate existing code from the use of
    > UserDict() to dict()? (UserString ...) What would be reasons against?
    > Reasons I can think of:
    > pro:
    > - Speed Improvement because of a level of indirection less
    > - UserDict can become deprecated
    >
    > con:
    > - Code not working whith older python
    > - cost of migrating large codebase
    >
    > Do you know other reasons?


    I think there are still some issues with subclassing the built-in
    types, but I've no idea what they are. (Hopefully somebody more
    knowledgeable will comment.)

    Your thought that a dict subclass might be faster than a UserDict
    subclass is plausible, but I'd strongly suggest doing some timing
    experiments before doing any large migration under that assumption.

    Otherwise, I think you've said everything.

    --
    Steven Taschuk "The world will end if you get this wrong."
    -- "Typesetting Mathematics -- User's Guide",
    Brian Kernighan and Lorrinda Cherry
     
    Steven Taschuk, Jul 22, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Skip Montanaro
    Replies:
    0
    Views:
    423
    Skip Montanaro
    Aug 15, 2003
  2. Alex Martelli

    UserDict question

    Alex Martelli, Nov 4, 2003, in forum: Python
    Replies:
    2
    Views:
    307
    Guyon Morée
    Nov 4, 2003
  3. John Lenton

    misguiding docs in 2.3's UserDict ?

    John Lenton, Jul 6, 2004, in forum: Python
    Replies:
    0
    Views:
    310
    John Lenton
    Jul 6, 2004
  4. Uwe Mayer

    UserDict deprecated

    Uwe Mayer, Jan 1, 2005, in forum: Python
    Replies:
    8
    Views:
    561
    Steve Holden
    Jan 3, 2005
  5. Steven Bethard
    Replies:
    8
    Views:
    405
    Nick Coghlan
    Jan 5, 2005
Loading...

Share This Page