Debian Codegraph @

tests/data/miscellaneous/force_pyi.py

raw
1 # flags: --pyi
2 from typing import Union
3
4 @bird
5 def zoo(): ...
6
7 class A: ...
8 @bar
9 class B:
10 def BMethod(self) -> None: ...
11 @overload
12 def BMethod(self, arg : List[str]) -> None: ...
13
14 class C: ...
15 @hmm
16 class D: ...
17 class E: ...
18
19 @baz
20 def foo() -> None:
21 ...
22
23 class F (A , C): ...
24 def spam() -> None: ...
25
26 @overload
27 def spam(arg: str) -> str: ...
28
29 var : int = 1
30
31 def eggs() -> Union[str, int]: ...
32
33 # output
34
35 from typing import Union
36
37 @bird
38 def zoo(): ...
39
40 class A: ...
41
42 @bar
43 class B:
44 def BMethod(self) -> None: ...
45 @overload
46 def BMethod(self, arg: List[str]) -> None: ...
47
48 class C: ...
49
50 @hmm
51 class D: ...
52
53 class E: ...
54
55 @baz
56 def foo() -> None: ...
57
58 class F(A, C): ...
59
60 def spam() -> None: ...
61 @overload
62 def spam(arg: str) -> str: ...
63
64 var: int = 1
65
66 def eggs() -> Union[str, int]: ...