[Python-Dev] PEP 343 - Abstract Block Redux
Robert Brewer
fumanchu at amor.org
Sat May 14 08:00:05 CEST 2005
Guido van Rossum wrote:
> I've written up the specs for my "PEP 340 redux" proposal as a
> separate PEP, PEP 343.
>
> http://python.org/peps/pep-0343.html
>
> Those who have been following the thread "Merging PEP 310 and PEP
> 340-redux?" will recognize my proposal in that thread, which received
> mostly positive responses there.
>
> Please review and ask for clarifications of anything that's unclear.
There's a typo in the code snippets at the moment.
The translation of the above statement is:
abc = EXPR
exc = () # Or (None, None, None) ?
try:
try:
VAR = abc.__enter__()
BLOCK
except:
exc = sys.exc_info()
raise
finally:
abc.__exit__(exc)
I think you meant "abc.__exit__(*exc)". Assuming that, then "exc =
(None, None, None)" makes the most sense. If exc_info() is going to be
passed as a single arg, then I'd rather have the default "exc = ()", so
I can simply check "if exc:" in the __exit__ method.
Robert Brewer
System Architect
Amor Ministries
fumanchu at amor.org
More information about the Python-Dev
mailing list