A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-April/052828.html below:

[Python-Dev] anonymous blocks

[Python-Dev] anonymous blocks [Python-Dev] anonymous blocksSamuele Pedroni pedronis at strakt.com
Fri Apr 22 02:44:17 CEST 2005
Guido van Rossum wrote:
> [Brett]
> 
>>I think I agree with Samuele that it would be more pertinent to put all of this
>>effort into trying to come up with some way to handle cleanup in a generator.
> 
> 
> I.e. PEP 325.
> 
> But (as I explained, and you agree) that still doesn't render PEP 310
> unnecessary, because abusing the for-loop for implied cleanup
> semantics is ugly and expensive, and would change generator semantics;
> and it bugs me that the finally clause's reachability depends on the
> destructor executing.
> 

yes, PEP325 would work in combination with PEP310, whether a combined 
thing (which cannot be the current for as dicussed) is desirable is a 
different issue: these anyway

f = file(...):
   for line in f:
     ...

vs.

it = gen():
   for val in it:
     ...

would be analogous in a PEP310+325 world.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4