On Sun, Mar 5, 2017 at 6:45 PM, Steven D'Aprano <st...@pearwood.info> wrote:

> I sometimes need to know if a list is homogenous, but unfortunately
> checking large lists for a common type in pure Python is quote slow.
>
> Here is a radical thought... why don't lists track their common type
> themselves? There's only a few methods which can add items:
>

For what it's worth, I suggested this a LONG time ago -- well before Python
ideas existed.... I thought a "homogenous sequence" could be rally useful
for all sorts of optimizations. (at the time I was writing C extensions,
and often  converting a lot of list to numpy arrays -- which ARE homogenous
sequences)

Anyway -- it was roundly rejected by Guido and others no one had any
interest in the idea.

But maybe now that there is a compelling use-case for the built in object
the time is right??

-CHB


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

chris.bar...@noaa.gov
_______________________________________________
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