[docs] [BUG] In python Array module

rashid bhat raashidbhatt at gmail.com
Sat Aug 2 17:27:06 CEST 2014


The array object on assignment does not  create a new object instead it
creates a reference to the assigned object  ( As expected it should create
a new object). Following code would be enough to prove it

*import array*

*foo = array.array("c", "hello")*
bar = foo

bar[0]  = "\x00"

print foo[0] gives "\x00" output while it should be hello

Raashid Bhat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20140802/81401f8c/attachment.html>

More information about the docs mailing list