[issue2144] os.environ should inherit dict

Raymond Hettinger report at bugs.python.org
Sun Feb 24 02:35:02 CET 2008


Raymond Hettinger added the comment:

Py3.0 updte:  UserDict is going to survive into Py3.0 and will be moved 
into the collections module.  DictMixin is replaced by the abstract 
base classes for mappings.

I think the discussion here has grown far beyond the original bug 
report.  I recommend this one be closed and that you start a thread on 
python-3000 or python-dev if you want to propose altering basic APIs or 
moving the ABC code into C.

I can't say that I support your "UserDict is a kludge ..." comment.  
The class has its uses and the standard library will continue to use it 
where appropriate.  

FWIW, at one time I also thought all uses of UserDict would ultimately 
be supplanted by dict subclassing, but I found that it was somewhat 
difficult to remove in some circumstances and that its API had some 
advantages (i.e. it's easier to write subclass code like self.data
[computedkey]=computedvalue than to dispatch to dict.__setitem__(self, 
computedkey, computedvalue) -- the latter form is somewhat errorprone 
when the subclass methods become more complex).

Will look at 1367711 as you suggest.

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2144>
__________________________________


More information about the Python-bugs-list mailing list