PY-20744 Compatibility inspection and annotator warn about variable annotations

This commit is contained in:
Mikhail Golubev
2016-09-16 08:16:26 +03:00
parent eb64521ae2
commit 409aad3f71
7 changed files with 49 additions and 0 deletions
@@ -0,0 +1,8 @@
class C:
x<error descr="Python version 3.5 does not support variable annotations">: int</error>
y<error descr="Python version 3.5 does not support variable annotations">: None</error> = 42
def m(self, d):
x<error descr="Python version 3.5 does not support variable annotations">: List[bool]</error>
d['foo']<error descr="Python version 3.5 does not support variable annotations">: str</error>
(d['bar'])<error descr="Python version 3.5 does not support variable annotations">: float</error>
@@ -0,0 +1,8 @@
class C:
x<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support variable annotations">: int</warning>
y<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support variable annotations">: None</warning> = 42
def m(self, d):
x<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support variable annotations">: List[bool]</warning>
d['foo']<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support variable annotations">: str</warning>
(d['bar'])<warning descr="Python version 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5 do not support variable annotations">: float</warning>