gauravssnl / skulpt

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

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

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 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 8 years ago
I think this may be fixed at head, but will have to confirm. tuple may not 
clone its argument because tuples are immutable anyway.

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

GoogleCodeExporter commented 8 years ago
(and removed request for browser/OS, since no, it's not normally relevant. 
there's occasionally some weird stuff on ie7, etc., but presumably that would 
be mentioned anyway. :)

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

GoogleCodeExporter commented 8 years ago
Issue 87 has been merged into this issue.

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

GoogleCodeExporter commented 8 years ago
Assuming HEAD = the latest push, no, I don't think it was fixed. I did push a 
fix to my own clone, however.

Original comment by carnioja...@gmail.com on 1 Apr 2011 at 9:39

GoogleCodeExporter commented 8 years ago
I'm not able to reproduce with the code in the original bug.

Original comment by sgraham on 3 Apr 2011 at 7:26

GoogleCodeExporter commented 8 years ago
Strange.. you sure you have no uncommitted code?

Original comment by carnioja...@gmail.com on 3 Apr 2011 at 8:44

GoogleCodeExporter commented 8 years ago
test/run/t316.py? I just added it, and "Works On My Machine". Let me know if
it doesn't for you for some reason.

Original comment by sgraham on 3 Apr 2011 at 9:11