| 1 |
a = 3 |
| 2 |
|
| 3 |
a |
| 4 |
|
| 5 |
b = 3 |
| 6 |
|
| 7 |
b |
| 8 |
|
| 9 |
c = 3 |
| 10 |
|
| 11 |
c |
| 12 |
|
| 13 |
d = "It should not read comments from the next line" |
| 14 |
|
| 15 |
|
| 16 |
d |
| 17 |
|
| 18 |
|
| 19 |
e = "It should not read comments from the previous line" |
| 20 |
|
| 21 |
e |
| 22 |
|
| 23 |
class BB: pass |
| 24 |
|
| 25 |
def test(a, b): |
| 26 |
a = a |
| 27 |
c = a |
| 28 |
d = a |
| 29 |
|
| 30 |
e = a |
| 31 |
|
| 32 |
|
| 33 |
a |
| 34 |
|
| 35 |
c |
| 36 |
|
| 37 |
d |
| 38 |
|
| 39 |
e |
| 40 |
|
| 41 |
class AA: |
| 42 |
class BB: |
| 43 |
pass |
| 44 |
|
| 45 |
def test(a): |
| 46 |
|
| 47 |
|
| 48 |
a |
| 49 |
|
| 50 |
def test(a): |
| 51 |
|
| 52 |
|
| 53 |
a |
| 54 |
|
| 55 |
a,b = 1, 2 |
| 56 |
|
| 57 |
a |
| 58 |
|
| 59 |
b |
| 60 |
|
| 61 |
class Employee: |
| 62 |
pass |
| 63 |
|
| 64 |
from typing import List, Tuple |
| 65 |
x = [] |
| 66 |
|
| 67 |
x[1] |
| 68 |
x, y, z = [], [], [] |
| 69 |
|
| 70 |
y[2] |
| 71 |
x, y, z = [], [], [] |
| 72 |
for zi in z: |
| 73 |
|
| 74 |
zi |
| 75 |
|
| 76 |
x = [ |
| 77 |
1, |
| 78 |
2, |
| 79 |
] |
| 80 |
|
| 81 |
|
| 82 |
x[1] |
| 83 |
|
| 84 |
|
| 85 |
for bar in foo(): |
| 86 |
|
| 87 |
bar |
| 88 |
|
| 89 |
for bar, baz in foo(): |
| 90 |
|
| 91 |
bar |
| 92 |
|
| 93 |
baz |
| 94 |
|
| 95 |
for bar, baz in foo(): |
| 96 |
|
| 97 |
""" type hinting on next line should not work """ |
| 98 |
|
| 99 |
bar |
| 100 |
|
| 101 |
baz |
| 102 |
|
| 103 |
with foo(): |
| 104 |
... |
| 105 |
|
| 106 |
with foo() as f: |
| 107 |
|
| 108 |
f |
| 109 |
|
| 110 |
with foo() as f: |
| 111 |
|
| 112 |
""" type hinting on next line should not work """ |
| 113 |
|
| 114 |
f |
| 115 |
|
| 116 |
aaa = some_extremely_long_function_name_that_doesnt_leave_room_for_hints() \ |
| 117 |
|
| 118 |
|
| 119 |
aaa |
| 120 |
|
| 121 |
|
| 122 |
class Dog: |
| 123 |
def __init__(self, age, friends, name): |
| 124 |
|
| 125 |
|
| 126 |
self.age = age |
| 127 |
self.friends = friends |
| 128 |
|
| 129 |
|
| 130 |
friends[0][1] |
| 131 |
|
| 132 |
|
| 133 |
self.name = name |
| 134 |
|
| 135 |
def friend_for_name(self, name): |
| 136 |
|
| 137 |
for (friend_name, friend) in self.friends: |
| 138 |
if friend_name == name: |
| 139 |
return friend |
| 140 |
raise ValueError() |
| 141 |
|
| 142 |
def bark(self): |
| 143 |
pass |
| 144 |
|
| 145 |
buddy = Dog(UNKNOWN_NAME1, UNKNOWN_NAME2, UNKNOWN_NAME3) |
| 146 |
friend = buddy.friend_for_name('buster') |
| 147 |
|
| 148 |
|
| 149 |
friend.bark() |
| 150 |
|
| 151 |
friend = buddy.friends[0][1] |
| 152 |
|
| 153 |
|
| 154 |
friend.bark() |
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
friend.name |
| 159 |
|
| 160 |
|
| 161 |
def annot(): |
| 162 |
|
| 163 |
pass |
| 164 |
|
| 165 |
|
| 166 |
annot() |
| 167 |
|
| 168 |
|
| 169 |
x = UNKNOWN_NAME2 |
| 170 |
|
| 171 |
|
| 172 |
x |
| 173 |
|
| 174 |
class Cat(object): |
| 175 |
def __init__(self, age, friends, name): |
| 176 |
|
| 177 |
self.age = age |
| 178 |
self.friends = friends |
| 179 |
self.name = name |
| 180 |
|
| 181 |
cat = Cat(UNKNOWN_NAME4, UNKNOWN_NAME5, UNKNOWN_NAME6) |
| 182 |
|
| 183 |
cat.name |
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
def x(a, b): |
| 188 |
|
| 189 |
|
| 190 |
a |
| 191 |
def x(a, b): |
| 192 |
|
| 193 |
|
| 194 |
a |
| 195 |
def x(a, b, c): |
| 196 |
|
| 197 |
|
| 198 |
b |
| 199 |
|
| 200 |
c |