Created
September 9, 2014 06:36
-
-
Save klang/0ce55aec4b64d84e51b1 to your computer and use it in GitHub Desktop.
Python oddities
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
# array | |
>>> [1] | |
[1] | |
>>> [1,] | |
[1] | |
# hash | |
>>> {'a':1} | |
{'a': 1} | |
>>> {'a':1,} | |
{'a': 1} | |
# set (not idiomatic) | |
>>> {1} | |
set([1]) | |
>>> {1,} | |
set([1]) | |
# list | |
>>> (1) | |
1 | |
# WHAT?!? | |
>>> (1,) | |
(1,) | |
# the ',' is the list constructor, not '(' as expected! | |
# why? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment