joe-greenawalt / skulpt

Automatically exported from code.google.com/p/skulpt
Other
0 stars 0 forks source link

list([...]) should make a copy of the list #87

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Code you're trying to run:
x = ["hello"]
y = list(x)
x[0] = "hi"
print y[0]

What does "real" Python output?
hello

What browser are you using? On what operating system?
Chrome 11.0.696 on OS X.6 (is this EVER relevant? :P)

Please provide any additional information.
Right now it seems list(x) simply returns x, rather than a shallow copy of x, 
as Python does. tuple(x) should probably do this too, but I'm unsure of how to 
test tuple()'s behavior.

Original issue reported on code.google.com by carnioja...@gmail.com on 30 Mar 2011 at 11:03

GoogleCodeExporter commented 9 years ago
Just pushed a fix to this bug. 
http://code.google.com/r/carniojack424-skulpt/source/list

Original comment by carnioja...@gmail.com on 30 Mar 2011 at 12:23

GoogleCodeExporter commented 9 years ago

Original comment by sgraham on 30 Mar 2011 at 5:24