1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
# these will match
def continue_at_end_of_while():
while True:
pass
continue
def continue_at_end_of_for_loop():
for _ in range(10):
pass
continue
def continue_at_end_of_else_block():
for x in range(10):
if x:
pass
else:
continue
def continue_in_match():
for x in range(10):
match x:
case 1:
pass
continue
case 2:
pass
continue
case _:
continue
def continue_in_with_block():
while True:
with open("file.txt") as f:
continue
# these will not
def continue_in_match_with_trailing_stmt():
for x in range(10):
match x:
case 1:
continue
case _:
continue
pass
def continue_match_with_single_continue():
for x in range(10):
match x:
case 1:
continue
case 2:
pass
def while_loop_with_just_a_continue():
while True:
continue
|