[New-bugs-announce] [issue28034] local var in "for v in iter" modify the uplevel var value.
jf
report at bugs.python.org
Thu Sep 8 22:15:37 EDT 2016
New submission from jf:
eg:
s = 'aaa'
print(s)
for s in '111', '222', '333':
print(s)
print(s)
the right result should be:
'aaa'
'111'
'222'
'333'
'aaa'
but, i got:
'aaa'
'111'
'222'
'333'
'333'
the local var in "for v in iter", modify the uplevel var value.
Is it wrong?
----------
components: Interpreter Core
messages: 275233
nosy: zaazbb
priority: normal
severity: normal
status: open
title: local var in "for v in iter" modify the uplevel var value.
type: behavior
versions: Python 3.5
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28034>
_______________________________________
More information about the New-bugs-announce
mailing list