Well, *I* know the implementation. And I know about NaN being neither less than or greater than anything else (even itself). And I know the basic working of Timsort.

But a lot of other folks, especially beginners or casual users, don't know all that.  The do know that fractional numbers are a thing one is likely to want a median of (whether or not they know IEEE-754 intimately). And they may or may not know that not-a-number is a float, but it's not that hard to arrive at by a computation.

Even if documentation vaguely hints at the behavior, it's a source of likely surprise. The fact that the median might be the very largest of a bunch of numbers (with at least one NaN in the collection) is surely not desired behavior, even if explainable.

Or e.g. two sets that compare as equal can have different medians according to the statistics module. I can construct that example if needed.

On Thu, Dec 26, 2019, 12:27 PM Richard Damon 
Note that the statistics module documentation implies the issue, as median implies that it requires the sequence to be orderable, and nan isn't orderable. Since the statistics module seems to be designed to handle types other than floats, detecting nan values is extra expensive, so I think it can be excused for not checking.