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/2009-March/087258.html below:

[Python-Dev] PEP 377 - allow __enter__() methods to skip the statement body

[Python-Dev] PEP 377 - allow __enter__() methods to skip the statement body [Python-Dev] PEP 377 - allow __enter__() methods to skip the statement bodyBaptiste Carvello baptiste13z at free.fr
Mon Mar 16 09:15:50 CET 2009
Nick Coghlan a écrit :
> 
> Implementing __with__ instead would give the CM complete control over
> whether or not to execute the block.
> 
please note, however, that this is an important change in the semantics of the 
with statement. As things are today, barring exceptional circunstances, the body 
of the with statement *will* be executed immediately. This allows to forget 
about the with statement when first reading code, as it doesn't change the 
intent of the programmer. What Glyph is proposing is more akin to Ruby code blocks.

cheers,
Baptiste

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