For review: PEP 343: Anonymous Block Redux and Generator Enhancements

Andrew Dalke dalke at dalkescientific.com
Sat Jun 4 13:59:27 EDT 2005


On Sat, 04 Jun 2005 10:43:48 -0600, Steven Bethard wrote:
> Ilpo Nyyssönen wrote:
>> How about this instead:
>> 
>> with locking(mutex), opening(readfile) as input:
>>     ...

> I don't like the ambiguity this proposal introduces.  What is input 
> bound to?

It would use the same logic as the import statement, which already
supports an 'as' like this

>>> import sys, math, cStringIO as StringIO, xml.sax.saxutils as su
>>> 

> But the point is 
> that, whatever decision you make, I now have to *memorize* that decision.

It's the same rule so the rule would be "ahh, uses the 'as' form".

				Andrew
				dalke at dalkescientific.com




More information about the Python-list mailing list