[Python-3000] Location of UserDict, UserList, and UserString
Raymond Hettinger
python at rcn.com
Sat Feb 9 22:33:57 CET 2008
In the process of getting UserDict updated to subclass from MutableMapping, it ended-up in the collections module during the
transistion. Probably, all three should end-up in the same place, either in the collections module or in their own modules. What
do you guys think? Do you like them in collections or as separate modules?
Also, I'm wondering if it is time for UserString to bite the dust. It isn't really useful in the same way a UserDict or UserList
which have two principal use cases. One, for testing to make sure that simulated dicts and lists are substitutable for real lists
and dicts. Two, for convenience in subclassing where it's easier to write "self.data[k]" than "dict.__getitem__(self, k)"
throughout.
It seems that wherever people could have worked with UserString for a mutable string, in practice they prefer to work with lists and
follow-up with a ''.join() afterwards.
Raymond
More information about the Python-3000
mailing list