An idea I haven't seen anyone suggest: Since testing for nan can be expensive, maybe it would make sense to provide a statistics.median_unsafe(), or perhaps median_fast(), method with the current implementation (for situations where a slow down isn't acceptable), and update the median() function to include the most reliable/comprehensive testing for nan?
If this were desirable it might also make sense to provide other, similar misbehaving *_unsafe or *_fast methods as well. On Sat, Dec 28, 2019, 9:35 PM Richard Damon <rich...@damon-family.org> wrote: > On 12/28/19 8:40 PM, David Mertz wrote: > > This is sophistry. NaN is an instance of the abstract type > > numbers.Number and the concrete type float. IEEE-754 defines NaN as > > collection of required values in any floating point type. > > > > I know the acronym suggests otherwise in a too-cute way, but NaN is > > archetypically a number in a computer science sense (but not in a pure > > math way, of course). > > > > Likewise, YAML (YAML Ain't Markup Language) is a markup language. And > > GNU (GNU's Not Unix) is a Unix system. > > NaN may be an instance of the abstract type Number, but is isn't a > mathematical number. It exists as that because it is a value of the type > float (and then adopted in some others). It is a floating point value > because in the Field of the Real Numbers, and the approximation made in > the floating point types, not all operations are closed under the full > domain of values, and because a computer hardware system needs to > produce SOME answer, the standard defined a value (or actually a set of > values) to represent these Non-Number answers. Yes, NaN really is a > value that represents Not A Number. > > Note, that the statistics module doesn't say it works with Numbers, but > with numeric data. > > Also, YAML is NOT a markup language, but a data serialization format. It > in fact started as Yet Another Markup Language, but when they realized > that what they were designing wasn't really a mark up language, but a > data based (not document formatting) language they change it to be more > descriptive. > > Also GNU isn't Unix, as Unix is a trademarked name for a specific set of > operating systems. GNU produced Linux, which is a mostly work-alike > operating system. Its sort of like saying Scotties isn't a Kleenex (Both > brands of facial tissues). > > > -- > > Richard Damon > _______________________________________________ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/CLUZDFDUOQPZU2LJ3I2I4TCDWQMWTFMA/ > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/G6DD63CPLNBNDAC7WQZPRAUFLEIZN7PM/ Code of Conduct: http://python.org/psf/codeofconduct/