[Python-Dev] PEP 340 -- concept clarification

Aahz aahz at pythoncraft.com
Tue May 3 19:31:32 CEST 2005


On Tue, May 03, 2005, Phillip J. Eby wrote:
> At 09:53 AM 5/3/05 -0700, Guido van Rossum wrote:
>>
>>I just came across another use case that is fairly common in the
>>standard library: redirecting sys.stdout. This is just a beauty (in
>>fact I'll add it to the PEP):
>>
>>def saving_stdout(f):
> 
> Very nice; may I suggest 'redirecting_stdout' as the name instead?

You may; I'd nitpick that to either "redirect_stdout" or
"redirected_stdout".  "redirecting_stdout" is slightly longer and doesn't
have quite the right flavor to my eye.  I might even go for "make_stdout"
or "using_stdout"; that relies on people understanding that a block means
temporary usage.

> This and other examples from the PEP still have a certain awkwardness
> of phrasing in their names.  A lot of them seem to cry out for a
> "with" prefix, although maybe that's part of the heritage of PEP 310.
> But Lisp has functions like 'with-open-file', so I don't think that
> it's *all* a PEP 310 influence on the examples.

Yes, that's why I've been pushing for "with".
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"It's 106 miles to Chicago.  We have a full tank of gas, a half-pack of
cigarettes, it's dark, and we're wearing sunglasses."  "Hit it."


More information about the Python-Dev mailing list