For the built-in float type in Python, the behaviour is a bit funny:
>>> nan=float('nan')
>>> a=[nan]
>>> nan in a
True
>>> any(nan==x for x in a)
False
(Because the `in` operator assumes that identity implies equality...)