Issue522558

classification
Title: list() is broken
Type: Severity: normal
Components: Core Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: bckfnn Nosy List: bckfnn, dinu_gherman
Priority: normal Keywords:

Created on 2002-02-25.18:12:06 by dinu_gherman, last changed 2002-03-11.13:23:34 by bckfnn.

Messages
msg590 (view) Author: Dinu C. Gherman (dinu_gherman) Date: 2002-02-25.18:12:06
###
### list() in CPython
###

[localhost:~] dinu% python
Python 2.2 (#1, Feb 13 2002, 11:18:45) 
[GCC 2.95.2 19991024 (release)] on darwin
Type "help", "copyright", "credits" or "license" for 
more information.
>>> 
>>> L = [1, 2, 3]
>>> L2 = list(L)
>>> L2
[1, 2, 3]
>>> L2.insert(0, 4)
>>> L2
[4, 1, 2, 3]
>>> L
[1, 2, 3]    ### as expected, same on CPython 2.1


###
### list() in Jython
###

[localhost:~] dinu% jython 
Jython 2.1 on java1.3.1 (JIT: null)
Type "copyright", "credits" or "license" for more 
information.
>>> 
>>> L = [1, 2, 3]    
>>> L2 = list(L)
>>> L2
[1, 2, 3]
>>> L2.insert(0, 4)
>>> L2
[4, 1, 2, 3]
>>> L
[4, 1, 2, 3]    ### unexpected
>>> 
>>> 
>>> import copy 
>>> L = [1, 2, 3]
>>> L3 = copy.copy(L) # instead of list() (use only 
for this snippet)
>>> L3.insert(0, 4)
>>> L3
[4, 1, 2, 3]
>>> L
[1, 2, 3]    ### as expected
msg591 (view) Author: Finn Bock (bckfnn) Date: 2002-03-11.13:21:48
Logged In: YES 
user_id=4201

Added as test355
msg592 (view) Author: Finn Bock (bckfnn) Date: 2002-03-11.13:23:34
Logged In: YES 
user_id=4201

Fixed in __builtin__.java: 2.43;
History
Date User Action Args
2002-02-25 18:12:06dinu_ghermancreate