Oh, I see now!  So ``nan`` is how Python represents nans, and this definition allows javascript to parse them. I think this is a good way to go about it. Could you add a small code comment explaining this?