[issue43078] Equality Errors when Unpickling and Pickling a Dictionary with a nan

2021-01-30 Thread Rohan Prasad
Rohan Prasad added the comment: I see this makes a ton of sense, thanks! I'll close this issue. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue43078] Equality Errors when Unpickling and Pickling a Dictionary with a nan

2021-01-30 Thread Dennis Sweeney
Dennis Sweeney added the comment: I think this is the expected behavior. It is expected by IEEE 754 that nan != nan, so that behavior exists: >>> nan = float('nan') >>> nan2 = float('nan') >>> assert nan != nan2 >>> assert nan != nan However, for "practicality beats purity" (speed) reasons,

[issue43078] Equality Errors when Unpickling and Pickling a Dictionary with a nan

2021-01-30 Thread Rohan Prasad
New submission from Rohan Prasad : Hi, I'm having a weird issue with floats in dictionaries and equality comparison (see attached screenshot for an example). When I create two dictionaries with a nan value they pass an equivalence test. However, if I pickle and unpickle one of the dictionari