| 1 |
from typing import Any, Tuple |
| 2 |
|
| 3 |
|
| 4 |
def f( |
| 5 |
a, # type: int |
| 6 |
): |
| 7 |
pass |
| 8 |
|
| 9 |
|
| 10 |
# test type comments |
| 11 |
def f(a, b, c, d, e, f, g, h, i): |
| 12 |
# type: (int, int, int, int, int, int, int, int, int) -> None |
| 13 |
pass |
| 14 |
|
| 15 |
|
| 16 |
def f( |
| 17 |
a, # type: int |
| 18 |
b, # type: int |
| 19 |
c, # type: int |
| 20 |
d, # type: int |
| 21 |
e, # type: int |
| 22 |
f, # type: int |
| 23 |
g, # type: int |
| 24 |
h, # type: int |
| 25 |
i, # type: int |
| 26 |
): |
| 27 |
# type: (...) -> None |
| 28 |
pass |
| 29 |
|
| 30 |
|
| 31 |
def f( |
| 32 |
arg, # type: int |
| 33 |
*args, # type: *Any |
| 34 |
default=False, # type: bool |
| 35 |
**kwargs, # type: **Any |
| 36 |
): |
| 37 |
# type: (...) -> None |
| 38 |
pass |
| 39 |
|
| 40 |
|
| 41 |
def f( |
| 42 |
a, # type: int |
| 43 |
b, # type: int |
| 44 |
c, # type: int |
| 45 |
d, # type: int |
| 46 |
): |
| 47 |
# type: (...) -> None |
| 48 |
|
| 49 |
element = 0 # type: int |
| 50 |
another_element = 1 # type: float |
| 51 |
another_element_with_long_name = 2 # type: int |
| 52 |
another_really_really_long_element_with_a_unnecessarily_long_name_to_describe_what_it_does_enterprise_style = ( |
| 53 |
3 |
| 54 |
) # type: int |
| 55 |
an_element_with_a_long_value = calls() or more_calls() and more() # type: bool |
| 56 |
|
| 57 |
tup = ( |
| 58 |
another_element, |
| 59 |
another_really_really_long_element_with_a_unnecessarily_long_name_to_describe_what_it_does_enterprise_style, |
| 60 |
) # type: Tuple[int, int] |
| 61 |
|
| 62 |
a = ( |
| 63 |
element |
| 64 |
+ another_element |
| 65 |
+ another_element_with_long_name |
| 66 |
+ element |
| 67 |
+ another_element |
| 68 |
+ another_element_with_long_name |
| 69 |
) # type: int |
| 70 |
|
| 71 |
|
| 72 |
def f( |
| 73 |
x, # not a type comment |
| 74 |
y, # type: int |
| 75 |
): |
| 76 |
# type: (...) -> None |
| 77 |
pass |
| 78 |
|
| 79 |
|
| 80 |
def f( |
| 81 |
x, # not a type comment |
| 82 |
): # type: (int) -> None |
| 83 |
pass |
| 84 |
|
| 85 |
|
| 86 |
def func( |
| 87 |
a=some_list[0], # type: int |
| 88 |
): # type: () -> int |
| 89 |
c = call( |
| 90 |
0.0123, |
| 91 |
0.0456, |
| 92 |
0.0789, |
| 93 |
0.0123, |
| 94 |
0.0456, |
| 95 |
0.0789, |
| 96 |
0.0123, |
| 97 |
0.0456, |
| 98 |
0.0789, |
| 99 |
a[-1], # type: ignore |
| 100 |
) |
| 101 |
|
| 102 |
c = call( |
| 103 |
"aaaaaaaa", "aaaaaaaa", "aaaaaaaa", "aaaaaaaa", "aaaaaaaa", "aaaaaaaa", "aaaaaaaa" # type: ignore |
| 104 |
) |
| 105 |
|
| 106 |
|
| 107 |
result = ( # aaa |
| 108 |
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" |
| 109 |
) |
| 110 |
|
| 111 |
AAAAAAAAAAAAA = [AAAAAAAAAAAAA] + SHARED_AAAAAAAAAAAAA + USER_AAAAAAAAAAAAA + AAAAAAAAAAAAA # type: ignore |
| 112 |
|
| 113 |
call_to_some_function_asdf( |
| 114 |
foo, |
| 115 |
[AAAAAAAAAAAAAAAAAAAAAAA, AAAAAAAAAAAAAAAAAAAAAAA, AAAAAAAAAAAAAAAAAAAAAAA, BBBBBBBBBBBB], # type: ignore |
| 116 |
) |
| 117 |
|
| 118 |
aaaaaaaaaaaaa, bbbbbbbbb = map(list, map(itertools.chain.from_iterable, zip(*items))) # type: ignore[arg-type] |