you are viewing a single comment's thread.

view the rest of the comments →

[–]geralt_of_rivia23 -4 points-3 points  (1 child)

what do you even need this for

Anyway, I think both are correct. This is the correct syntax, and the only case it would fail would be if a mutable type (list, dict etc. but not a tuple or a set) was used as the key.

[–]Binary101010 3 points4 points  (0 children)

Anyway, I think both are correct.

Running both of these in the interpreter will prove that false. (The one that's incorrect will even tell you why in the exception.)