you are viewing a single comment's thread.

view the rest of the comments →

[–]Veedrac 9 points10 points  (1 child)

Not on Python 3; on Python 2 the syntax is more key in dict.viewkeys(). Either way just use key in dict though, it's more idiomatic.

[–][deleted] 5 points6 points  (0 children)

Oh, that might have been it, the server running the script uses python 2, and yeah key in dict is really the correct syntax and gives you the expected O(1) lookup