[Python-3000] Location of UserDict, UserList, and UserString
Steven Bethard
steven.bethard at gmail.com
Sat Feb 9 22:52:44 CET 2008
On Feb 9, 2008 2:33 PM, Raymond Hettinger <python at rcn.com> wrote:
> 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?
+1 for putting them in the collections module.
> 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.
I thought this was the point of DictMixin, not UserDict, no?
> Two, for convenience in subclassing where it's easier to write "self.data[k]"
> than "dict.__getitem__(self, k)" throughout.
Interesting. I'd never seen this before, but a Google code search
reveals that it is reasonably common. Too bad. I was hoping that the
new ABCs would eliminated the need for UserDict and UserList
entirely...
STeVe
--
I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a
tiny blip on the distant coast of sanity.
--- Bucky Katt, Get Fuzzy
More information about the Python-3000
mailing list