Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > UserDict -> dict, reasons for migrating existing code

Reply
Thread Tools

UserDict -> dict, reasons for migrating existing code

 
 
Andreas Kuntzagk
Guest
Posts: n/a
 
      07-21-2003
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
 
Reply With Quote
 
 
 
 
Steven Taschuk
Guest
Posts: n/a
 
      07-22-2003
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."
http://www.velocityreviews.com/forums/(E-Mail Removed) -- "Typesetting Mathematics -- User's Guide",
Brian Kernighan and Lorrinda Cherry

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why does UserDict.DictMixin use keys instead of __iter__? Steven Bethard Python 8 01-05-2005 12:58 PM
UserDict deprecated Uwe Mayer Python 8 01-03-2005 02:25 PM
misguiding docs in 2.3's UserDict ? John Lenton Python 0 07-06-2004 04:24 PM
25 Reasons to Aviod the SD-10 (was 15 Reasons to Aviod the SD-10) Steven M. Scharf Digital Photography 823 07-02-2004 12:55 PM
UserDict question Alex Martelli Python 2 11-04-2003 03:32 PM



Advertisments