[issue21943] To duplicate a list has biyective properties, not inyective ones

2014-07-09 Thread Mark Dickinson
Changes by Mark Dickinson : -- resolution: -> not a bug status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue21943] To duplicate a list has biyective properties, not inyective ones

2014-07-09 Thread Josh Rosenberg
Josh Rosenberg added the comment: Short answer: This is not a bug. Run through one of the comprehensive Python tutorials on the net (or in Learning Python); reference semantics and their fairly varied consequences are covered in detail in most of them. -- _

[issue21943] To duplicate a list has biyective properties, not inyective ones

2014-07-09 Thread Josh Rosenberg
Josh Rosenberg added the comment: This is a natural consequence of Python using reference semantics. x = y just makes x and y references to the same object. For immutable objects like int and str, you'll never notice consequences of this, since changes to the value (x += 1) replace the refere

[issue21943] To duplicate a list has biyective properties, not inyective ones

2014-07-09 Thread Toni Diaz
New submission from Toni Diaz: Python 2.7.3 (default, Mar 13 2014, 11:03:55) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> a=['dog'] >>> b=a >>> a ['dog'] >>> b ['dog'] >>> b.remove('dog') >>> a [] >>> b [] >>> When defining a list from another