OILS / mycpp / examples / invalid_python.py View on Github | oilshell.org

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