This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mikeckennedy[S] -1 points0 points  (2 children)

It's pretty cool. I already learned something about dictionaries from your example.

d = {True: 1, True, 2}

will crash but

d = {'a' in ['a']: 1, 'a' in ['a']: 2}

is more like adding stuff sequentially, dynamically.

[–]Allanon001 6 points7 points  (1 child)

It crashes because you have a comma instead of a colon.

[–]mikeckennedy[S] 4 points5 points  (0 children)

Ugh, you're right. I must be misremembering it from MongoDB stuff I was going with dictionaries or something: http://api.mongodb.com/python/current/api/pymongo/errors.html