Created
April 19, 2012 15:42
-
-
Save litzomatic/2421824 to your computer and use it in GitHub Desktop.
Python: A bug waiting to happen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A Python bug waiting to happen. | |
>>> x = ['1', '2', '3'] | |
>>> x[:] = x[0] | |
>>> x | |
['1'] | |
>>> x = ['10', '2', '3'] | |
>>> x[:] = x[0] | |
>>> x | |
['1', '0'] | |
>>> x[:] = x[0:1] | |
>>> x | |
['1'] | |
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment