[New-bugs-announce] [issue30729] Swap doesn't work in some circumstances

Hang Liao report at bugs.python.org
Thu Jun 22 01:38:50 EDT 2017


New submission from Hang Liao:

Suppose I have two lists 
L1 = [1,3,2,4], L2 = [1,3,2,4]
L1[1], L1[2] = L1[2], L1[1]
This gives me L1 = [1,2,3,4]
However, if I write
L2[1], L2[L2[1] - 1] = L2[L2[1] - 1], L2[1]
This gives me back the same L2 = [1,3,2,4]
I am not sure if this is a mistake ... If it is what it intended to do please tell me.

----------
components: macOS
messages: 296614
nosy: Ikaros, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Swap doesn't work in some circumstances
type: behavior
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30729>
_______________________________________


More information about the New-bugs-announce mailing list