Of course it's permitted; just like
try: if True: while True: pass
would also be permitted. That doesn't mean that you want to write (or see) code like that :)
Of course it's permitted; just like
try:
while True:
pass
if True:
would also be permitted. That doesn't mean that you want to write (or see) code like that :)