pylint #37842 detect UnboundLocalError: local variable referenced before assignment [open]
This is a quite common Python error, which can be triggered by:
Having pylint detecting this would be very nice. | |
priority | normal |
---|---|
type | enhancement |
done in | <not specified> |
closed by | <not specified> |
Comments
-
2013/05/21 13:50, written by DanielK
add commentThe following code is obviously wrong but pylint 0.25.1 won't see it:
def main():
"""Main"""
condition = False
if condition:
quux = 3
string = '{quux}' if condition else 'foobar'
print string.format(quux=quux)