As a follow-up to #1174 and #6197, we should perhaps allow two assignments to create independent variables whenever the lifetimes of the variables don't overlap (when using --allow-redefinitions).
Example:
iffoo():
x=0print(x)
else:
x='a'# Define a new variable?print(x)
Another example:
forxin [1, 2]:
print(x)
iffoo():
forxin ['a', 'b']: # Define a new variable?print(x)
As a follow-up to #1174 and #6197, we should perhaps allow two assignments to create independent variables whenever the lifetimes of the variables don't overlap (when using
--allow-redefinitions).Example:
Another example: