Python and me

I like Python, but I’d love it if it had support for types – even if one of them was a generic duck-typed object or variant.

x = {}
k = "potential key"
v = MyValue() # Clearly not a key
 
if v in x:
  pass # Always fails silently
 

I apparently live and learn.

Update! Apparently I’m stupid while summarizing the error (always copy, never recall). I did not use k in the if statement, rather, I used v which is not a key. This is a programmer error. However, Python does not tell me so, it just does what it asks it to do, i.e. tell me if the not-a-key is a key.

Thanks to Ralk for pointing this out.