1 | #!/usr/bin/env python2
|
2 | """
|
3 | invalid_python.py
|
4 | """
|
5 | from __future__ import print_function
|
6 |
|
7 | import sys
|
8 |
|
9 | from typing import List, Any, Iterator
|
10 |
|
11 |
|
12 | def visit_star(x):
|
13 | # type: (Any) -> None
|
14 | pass
|
15 |
|
16 |
|
17 | def f():
|
18 | # type: () -> Iterator[int]
|
19 | yield 42
|
20 |
|
21 |
|
22 | myglobal = 'bad'
|
23 |
|
24 |
|
25 | def g():
|
26 | # type: () -> None
|
27 | global myglobal
|
28 | print('g')
|
29 |
|
30 | exec('print("hi")')
|
31 |
|
32 |
|
33 | class Base:
|
34 | pass
|
35 |
|
36 |
|
37 | class Derived:
|
38 |
|
39 | def __init__(self):
|
40 | # type: () -> None
|
41 |
|
42 | # Hm not hitting this error
|
43 | super(self)
|
44 |
|
45 |
|
46 | def main():
|
47 | # type: () -> None
|
48 |
|
49 | # Not handled
|
50 | print(u'unicode')
|
51 |
|
52 | # This is accepted -- as StrExpr?
|
53 | print(b'bytes')
|
54 |
|
55 | mycomplex = 3j
|
56 |
|
57 | myset = {1, 2}
|
58 |
|
59 | mylist = ['hi']
|
60 | # This is somehow accepted? Not StarExpr?
|
61 | visit_star(*mylist)
|