Oct. 4, 2012
5:49 p.m.
On Thu, Oct 4, 2012 at 6:53 AM, Steven D'Aprano <steve@pearwood.info> wrote:
I'm not sure what you are doing here, because dicts (at least in Python 3.2) already short-circuit equality:
py> NAN = float('nan') py> NAN == NAN False py> d = {NAN: 42} py> d[NAN] 42
Actually, that behaviour goes back to at least 2.4, so I'm not sure how you are doing memoization and not seeing the same optimization.
It was my mistake... I do see this optimization now that I know where to look for it. Thanks for clarifying this.