Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(734)

Issue 1734044: T542 - Support for relative import

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 10 months ago by Haoyu Bai
Modified:
13 years, 8 months ago
Reviewers:
craigcitro
Visibility:
Public.

Patch Set 1 : updated patch #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+57 lines, -7 lines) Patch
M Cython/Compiler/ExprNodes.py View 4 chunks +20 lines, -4 lines 1 comment Download
M Cython/Compiler/Parsing.pxd View 1 chunk +1 line, -1 line 0 comments Download
M Cython/Compiler/Parsing.py View 4 chunks +16 lines, -1 line 2 comments Download
M runtests.py View 1 chunk +1 line, -0 lines 0 comments Download
M tests/compile/fromimport.pyx View 1 chunk +6 lines, -1 line 0 comments Download
A tests/run/relativeimport_T542.pyx View 1 chunk +13 lines, -0 lines 0 comments Download

Messages

Total messages: 1
craigcitro
13 years, 8 months ago (2010-08-18 07:10:24 UTC) #1
LGTM

Everything looks good here -- there may be some weird corner case we're not
thinking of, but getting this code in use is the only way to find that kind of
thing ...

http://codereview.appspot.com/1734044/diff/2001/3001
File Cython/Compiler/ExprNodes.py (right):

http://codereview.appspot.com/1734044/diff/2001/3001#newcode1603
Cython/Compiler/ExprNodes.py:1603: #  level         int                  
relative import level
Maybe mention that the default is -1? (This was surprising to me, at least)

http://codereview.appspot.com/1734044/diff/2001/3003
File Cython/Compiler/Parsing.py (right):

http://codereview.appspot.com/1734044/diff/2001/3003#newcode1177
Cython/Compiler/Parsing.py:1177: s.error("Relative cimport is not supported")
Any reason you couldn't move this up above the call to p_dotted_name, so it's
next to the similar code for import?

http://codereview.appspot.com/1734044/diff/2001/3003#newcode1201
Cython/Compiler/Parsing.py:1201: if dotted_name == '__future__':
It's not a big deal, but we should probably raise an error here if level isn't
-1, since code like "from .__future__ import foo" is bad (though harmless enough
...)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b