classification
Title: bla in cpython/Lib/test/test_sys_settrace.py
Type: Stage: resolved
Components: Tests Versions: Python 3.11
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: iritkatriel, zhangchaospecial
Priority: normal Keywords:

Created on 2021-06-24 09:40 by zhangchaospecial, last changed 2021-06-24 10:09 by iritkatriel. This issue is now closed.

Messages (2)
msg396465 - (view) Author: zcpara (zhangchaospecial) * Date: 2021-06-24 09:40
In cpython/Lib/test/test_sys_settrace.py, there is a function:
1 def no_pop_blocks():
2    y = 1
3    while not y:
4        bla
5    x = 1

what does bla mean? bla is not defined anywhere. But the function can pass the compilation. bla is treated as a global name in symtable during compilation. Why does python allow this statement (line 4)? Will line 4 be deleted in the future? Or be replaced with pass?
msg396467 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-06-24 10:09
y = 1, so the body of the while loop will never execute and the name will never need to be resolved.

The bug tracker is not an appropriate place to ask questions about the code, it is for reporting bugs in python.
History
Date User Action Args
2021-06-24 10:09:08iritkatrielsetstatus: open -> closed

nosy: + iritkatriel
messages: + msg396467

resolution: not a bug
stage: resolved
2021-06-24 09:40:58zhangchaospecialcreate