[Python-ideas] Pre-PEP 2nd draft: adding a statistics module to Python

Steven D'Aprano steve at pearwood.info
Thu Aug 8 17:23:25 CEST 2013


On 09/08/13 00:58, Guido van Rossum wrote:
> --Guido van Rossum (sent from Android phone)
> On Aug 8, 2013 7:29 AM, "Steven D'Aprano" <steve at pearwood.info> wrote:
>> - one-pass algorithm for variance is deferred until Python 3.5, until
> then, lists are the preferred data structure (iterators will continue to
> work, provided they are small enough to be converted to lists).
>
> How do you plan to distinguish between lists and iterators?


I haven't yet decided between these two snippets:

# option 1
if data is iter(data):
     data = list(data)


# option 2
if not isinstance(data, collections.Sequence):
     data = list(data)


although I'm currently leaning towards option 1.



-- 
Steven


More information about the Python-ideas mailing list