[Python-ideas] Fwd: NAN handling in the statistics module

David Mertz mertz at gnosis.cx
Thu Jan 10 12:06:07 EST 2019


>
> One possible argument for making PASS the default, even if that means
>> implementation-dependent behaviour with NANs, is that in the absense of a
>> clear preference for FAIL or RETURN, at least PASS is backwards compatible.
>>
>> You might shoot yourself in the foot, but at least you know its the same
>> foot you shot yourself in using the previous version *wink*
>>
>
I've lost attribution chain. I think this is Steven, but it doesn't really
matter.

This statement is untrue, or at least only accidentally true at most. The
behavior of sorted() against partially ordered collections is unspecified.
The author of Timsort says exactly this.

If stastics.median() keeps the same implementation—or keeps it with a PASS
argument—it may or may not produce the same result in a later Python
versions. Timsort is great, but even that has been tweaked sightly over
time.

I guess the statement is true if "same foot" means "meaningless answer" not
some specific value. But that hardly feels like a defense of the behavior.

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190110/fbc462c8/attachment.html>


More information about the Python-ideas mailing list