[issue44770] float('nan') is True

2021-07-28 Thread Tim Peters
Tim Peters added the comment: Sorry, I'm just going to close this. For values of all numeric types now, `bool(x)` returns the same as `x != type(x)(0)`. Besides being backward-incompatible, making an exception for NaN would be jarringly inconsistent. Note that you don't need numpy to conven

[issue44770] float('nan') is True

2021-07-28 Thread Dennis Sweeney
Dennis Sweeney added the comment: Do you have a particular use case for this? This is a backwards-incompatible change, and the existing behavior (the only false-y float being 0.0) is very old and well-established. If this change was implemented, I suspect almost every use of it would benefit

[issue44770] float('nan') is True

2021-07-28 Thread Marty
New submission from Marty : I know that there is numpy.isnan() for checking if a value is float('nan') but I think that native python should logically return False in bool(float('nan')). -- messages: 398448 nosy: vpjtqwv0101 priority: normal severity: normal status: open title: float('