[Python-ideas] change list() - branch from "More useful slices"

Eugene Toder eltoder at gmail.com
Mon Feb 2 23:03:37 CET 2015


On Mon, Feb 2, 2015 at 4:19 PM, Ryan Gonzalez <rymg19 at gmail.com> wrote:

> On Mon, Feb 2, 2015 at 1:47 PM, Thomas Kluyver <thomas at kluyver.me.uk>
> wrote:
>
>> 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.
>
Arguably, min and max of a single value is that same value. This is what
min() and max() return when you pass them a 1-element sequence.

Eugene
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150202/7542625c/attachment.html>


More information about the Python-ideas mailing list