You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jik@hostname:~/projects/test$ pytype --version
2024.10.11
jik@hostname:~/projects/test$ pytype simple.py
Computing dependencies
Analyzing 1 sources with 0 local dependencies
ninja: Entering directory `.pytype'
[1/1] check simple
FAILED: /home/jik/projects/test/.pytype/pyi/simple.pyi
/usr/bin/python3 -m pytype.main --imports_info /home/jik/projects/test/.pytype/imports/simple.imports --module-name simple --platform linux -V 3.10 -o /home/jik/projects/test/.pytype/pyi/simple.pyi --analyze-annotated --nofail --quick /home/jik/projects/test/simple.py
/home/jik/projects/test/simple.py:2:1: error: in <lambda>: Name 'b' is not defined [name-error]
lam = lambda: b~~~~~~~~~~~~~~
lam = lambda: b
For more details, see https://google.github.io/pytype/errors.html#name-error
ninja: build stopped: subcommand failed.
Leaving directory '.pytype'
It passes again if I replace the pass by break or if I change the while True to while False/if True/if False, so I guess there's something particular with the infinite loop that confuses pytype.
The text was updated successfully, but these errors were encountered:
Jik
changed the title
Infinite loop at the end of file confuses pytype with global lambda referring to a global variable
Infinite loop at the end of file makes pytype output name-error with global lambda referring to a global variable
Nov 20, 2024
Consider the following file
This passes pytype without problems.
However, adding an extra while loop at the end:
I now get an error:
It passes again if I replace the
pass
bybreak
or if I change thewhile True
towhile False
/if True
/if False
, so I guess there's something particular with the infinite loop that confuses pytype.The text was updated successfully, but these errors were encountered: