Author dalke
Recipients arigo, christian.heimes, dalke, loewis, rhettinger, tds333
Date 2008-01-12.11:30:50
SpamBayes Score 0.0151597
Marked as misclassified No
Message-id <1200137455.6.0.737187517086.issue1367711@psf.upfronthosting.co.za>
In-reply-to
Content
I was optimization tuning and wondered why UserDict was imported by os.  Replacing 
UserDict with dict passes all existing regression tests.

I see the concerns that doing that replacement is not future proof.  Strange then 
that Cookie.py is acceptable.  There are three places in Lib which derive from dict, 
and two are in Cookie.py and in both cases it's broken because set_default does not 
go through the same checks that __setitem__ goes through.

(The other place is an internal class in _strptime.)

In looking over existing third-party code, I see this nuance of when to use UserDict 
vs. dict isn't that well known.  The documentation says "The need for this class has 
been largely supplanted by the ability to subclass directly from dict", but that 
isn't true if anyone is worried about future-proofing and where the subclass changes 
one of the standard methods.
History
Date User Action Args
2008-01-12 11:30:55dalkesetspambayes_score: 0.0151597 -> 0.0151597
recipients: + dalke, loewis, arigo, rhettinger, tds333, christian.heimes
2008-01-12 11:30:55dalkesetspambayes_score: 0.0151597 -> 0.0151597
messageid: <1200137455.6.0.737187517086.issue1367711@psf.upfronthosting.co.za>
2008-01-12 11:30:50dalkelinkissue1367711 messages
2008-01-12 11:30:50dalkecreate