1
2
3 """
4 The module for testing variable annotations.
5 Empty lines above are for good reason (testing for correct line numbers)
6 """
7
8 from typing import Optional
9 from functools import wraps
10
11 __annotations__[1] = 2
12
13 class ESC[4;38;5;81mC:
14
15 x = 5; y: Optional['C'] = None
16
17 from typing import Tuple
18 x: int = 5; y: str = x; f: Tuple[int, int]
19
20 class ESC[4;38;5;81mM(ESC[4;38;5;149mtype):
21
22 __annotations__['123'] = 123
23 o: type = object
24
25 (pars): bool = True
26
27 class ESC[4;38;5;81mD(ESC[4;38;5;149mC):
28 j: str = 'hi'; k: str= 'bye'
29
30 from types import new_class
31 h_class = new_class('H', (C,))
32 j_class = new_class('J')
33
34 class ESC[4;38;5;81mF():
35 z: int = 5
36 def __init__(self, x):
37 pass
38
39 class ESC[4;38;5;81mY(ESC[4;38;5;149mF):
40 def __init__(self):
41 super(F, self).__init__(123)
42
43 class ESC[4;38;5;81mMeta(ESC[4;38;5;149mtype):
44 def __new__(meta, name, bases, namespace):
45 return super().__new__(meta, name, bases, namespace)
46
47 class ESC[4;38;5;81mS(metaclass = ESC[4;38;5;149mMeta):
48 x: str = 'something'
49 y: str = 'something else'
50
51 def foo(x: int = 10):
52 def bar(y: List[str]):
53 x: str = 'yes'
54 bar()
55
56 def dec(func):
57 @wraps(func)
58 def wrapper(*args, **kwargs):
59 return func(*args, **kwargs)
60 return wrapper
61
62 u: int | float