UserDict -> dict, reasons for migrating existing code

A

Andreas Kuntzagk

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
 
S

Steven Taschuk

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top