On 22/01/2007 23.45, Collin Winter wrote:
> target, thus eliminating the reference cycle. The source-to-source
> translation, as suggested by Phillip J. Eby [#except-translation]_ is
> ::
>
> try:
> ...
> except E as N:
> ...
> ...
>
> is translated to ::
>
> try:
> ...
> except E as N:
> ...
> N = None
> del N
> ...
>
The mail you link (which matched my recollection of the thread) has an
additional try/finally suite in the except block translation:
except ExcType, e:
try:
# body
finally:
e = None
del e
which is missing in the PEP. I think you should probably explain why the
try/finally is not needed (if it really is not).
Also, the second code snippet should probably use the "except E, N" form (no
"as") to make more clear that you're speaking of the Python 2.x equivalent of
the 3.x form.
--
Giovanni Bajo
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com