[Python-ideas] change list() - branch from "More useful slices"
Ryan Gonzalez
rymg19 at gmail.com
Mon Feb 2 22:19:19 CET 2015
On Mon, Feb 2, 2015 at 1:47 PM, Thomas Kluyver <thomas at kluyver.me.uk> wrote:
> On 2 February 2015 at 11:43, Paul Moore <p.f.moore at gmail.com> wrote:
>
>> So there would be a discontinuity - list('foo') would have to be ['f',
>> 'o', 'o'] for backward compatibility. And that makes list(*args)
>> problematic, as it behaves differently if len(args)==1.
>>
>
> max() and min() do behave like this - they accept either a single
> iterable, or *args - so it's not unprecedented. But I don't see any benefit
> to adding it to the list() constructor.
>
Because the maximum/minimum of a single value makes absolutely no sense,
but a single-element list does.
>
>
> Thomas
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
Ryan
If anybody ever asks me why I prefer C++ to C, my answer will be simple:
"It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that was
nul-terminated."
Personal reality distortion fields are immune to contradictory evidence. -
srean
Check out my website: http://kirbyfan64.github.io/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150202/56e5090c/attachment-0001.html>
More information about the Python-ideas
mailing list