Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

I think you guys need to post your code somewhere (perhaps on PyPi or the ASPN 
Cookbook).  It needs to mature beyond the stage of "I just whipped-up this code 
and think it would be great if everybody used it".

I've seen nothing like this being used in production code (code published on 
the net or at one of my clients).  Context managers have been around for a 
while, so if this were a real need, we would expect to see people already using 
something like this (for example, namedtuples got introduced to the standard 
library upon seeing many, many reinventions of the concept and we were able to 
consolidate the best features from each).

Design of the a feature in the standard library should be driven by examples of 
real world code that would be improved with the new feature.  The design should 
also be informed by the experience of teaching people how to use it and seeing 
what they do (lots of technically correct ideas get shot down because it turns 
out that incorrect usage is common (a bug factory like the % formatting 
operator) or that people have a hard time learning and remembering the feature.

The core problem is that it is easier to add things to the standard library 
than to take them out if they prove to be a bad idea.  Accordingly, we need to 
be *really sure* that this is a good idea, that it will *improve* real world 
code, that people learn, understand, and remember it easily, and that is 
doesn't impair readability.

The example code from Nikolaus has a bug in it -- that is worrisome and may 
suggest that we are better-off without this being in the standard library.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13585>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to