Fixed parsing ellipsis as an expression in Python 3 (PY-8257)

In Python 3 ellipsis can appear anywhere, not only in sequence slicings. The parser
now always passes ellipsis, it's incorrect use is detected at the unsupported features
annotator or compatibility inspection levels.
This commit is contained in:
Andrey Vlasovskikh
2013-02-18 16:08:33 +04:00
parent 8b5b707e9c
commit 377662303c
14 changed files with 164 additions and 98 deletions
@@ -0,0 +1,2 @@
def foo():
<warning descr="Python versions < 3.0 do not support '...' outside of sequence slicings.">...</warning>
@@ -0,0 +1,5 @@
import numpy
x = numpy.zeros((3, 4, 5))
y = x[..., 0] # pass
y = x[..., 0, :] # pass