On Mon, Mar 6, 2017 at 12:53 PM, Elliot Gorokhovsky
<elliot.gorokhov...@gmail.com> wrote:
> (1) lists are idiomatically type-homogeneous. To quote the Python
> documentation, "Lists are mutable, and *their elements are usually
> homogeneous* and are accessed by iterating over the list".
> (2) it's not very common to have to "compare apples and oranges". While it's
> technically possible to define comparison between any two types you like,
> and in practice one sometimes compares e.g. ints and floats, in practice
> it's pretty safe to assume the lists you're sorting are going to be
> type-homogeneous 95% or 99% of the time.

I would be rather curious to know how frequently a list consists of
"numbers", but a mix of ints and floats. From the point of view of a
list's purpose, they're all numbers (point 1 satisfied), and they're
all comparable (point 2 satisfied), but from the POV of your patch,
it's heterogeneous and suffers a performance penalty. Does it happen a
lot in real-world code?

(Apologies if this has already been mentioned; I've been skimming the
thread, not reading it in detail.)

ChrisA
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to