This looks good, but I think we can go a little further. In particular, I ...
13 years, 8 months ago
(2010-08-18 08:04:45 UTC)
#1
This looks good, but I think we can go a little further. In particular, I think
we can set things to None (since we can't del), and we can make sure that we
cover all the various syntax variations the PEP describes.
http://codereview.appspot.com/1556042/diff/2001/3002
File Cython/Compiler/ParseTreeTransforms.py (right):
http://codereview.appspot.com/1556042/diff/2001/3002#newcode838
Cython/Compiler/ParseTreeTransforms.py:838: # Transform the except clause body
by following the PEP3110 sematic
sematic -> semantics
http://codereview.appspot.com/1556042/diff/2001/3002#newcode839
Cython/Compiler/ParseTreeTransforms.py:839: # of excpetion catching
excpetion -> exception
http://codereview.appspot.com/1556042/diff/2001/3002#newcode840
Cython/Compiler/ParseTreeTransforms.py:840: # XXX(haoyu) There should be 'del
EXC' but del is not supported yet
It's true that we don't support del -- however, we *can* at least set EXC to
None, and confirm that it's been set to None. It's bad that the name is still
defined, but this will still solve the reference counting problem (which, as I
understand, is part of the purpose of the PEP).
Also, XXX -> TODO
http://codereview.appspot.com/1556042/diff/2001/3002#newcode851
Cython/Compiler/ParseTreeTransforms.py:851: # Only do this tranform for Python 3
tranform -> transform
http://codereview.appspot.com/1556042/diff/2001/3003
File tests/run/cython3.pyx (right):
http://codereview.appspot.com/1556042/diff/2001/3003#newcode29
tests/run/cython3.pyx:29: return
So this confirms that we can use the new syntax -- but shouldn't we also check
that foo has been set to None?
Also, several other forms of try/except have been disallowed as part of the PEP;
we should have tests for all of them. Even if we don't support them, it's good
to know what we do and don't support.
Issue 1556042: T541 - Exception catching semantic change in Python 3
Created 13 years, 10 months ago by Haoyu Bai
Modified 13 years, 8 months ago
Reviewers: craigcitro
Base URL:
Comments: 5