[Python-ideas] "any" and "all" support multiple arguments

Lucas Wiman lucas.wiman at gmail.com
Tue Aug 1 13:22:03 EDT 2017


On Tue, Aug 1, 2017 at 6:01 AM, Louie Lu <me at louie.lu> wrote:

> [...]
> I'm not sure if this is discuss before, but can "any" and "all"
> support like min_max "arg1, arg2, *args" style?
>

Can this be done consistently? For example consider x=[[]]. Then all(x)
where x is interpreted as an iterable should be False, but all(x) where x
is interpreted as a single argument should be True. This inconsistency
already exists for max:

>>> max({1, 2})
2
>>> max({1, 2}, {1})
set([1, 2])

However, it doesn't seem like there's a good reason to add an inconsistency
to the API for any/all.

- Lucas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170801/3ba709c8/attachment.html>


More information about the Python-ideas mailing list