On Tuesday, August 1, 2017 at 12:58:24 PM UTC-4, Clément Pit-Claudel wrote:
>
> On 2017-08-01 17:28, Nick Coghlan wrote:
> > Right, the main correspondence here is with "sum()": folks can't write
> > "sum(a, b, c)", but they can write "a + b + c".
> >
> > The various container constructors are a
On 8/1/2017 9:01 AM, Louie Lu wrote:
Hi all,
In "min" and "max" builtin-func, it support two style of args:
min(...)
min(iterable, *[, default=obj, key=func]) -> value
min(arg1, arg2, *args, *[, key=func]) -> value
To me, two APIs is a nuisance. For one thing, default
On Tue, Aug 1, 2017 at 6:01 AM, 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 Fa
On 2017-08-01 17:28, Nick Coghlan wrote:
> Right, the main correspondence here is with "sum()": folks can't write
> "sum(a, b, c)", but they can write "a + b + c".
>
> The various container constructors are also consistent in only taking
> an iterable, with multiple explicit items being expected t
On 1 August 2017 at 23:24, Paul Moore wrote:
> On 1 August 2017 at 14:01, 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?
>
> I don't see any particular reason why not, but is there a specific use
> case for thi
On 1 August 2017 at 23:43, Ned Batchelder wrote:
> I find it frustrating that they always return booleans. It would be more
> useful if any() returned the first true value it finds. This seems like a
> backward-compatible-enough change to me... :)
While I'm not sure how to interpret that smiley
I find it frustrating that they always return booleans. It would be
more useful if any() returned the first true value it finds. This seems
like a backward-compatible-enough change to me... :)
--Ned.
On 8/1/17 9:32 AM, Markus Meskanen wrote:
> I'd be more interested in supporting the "key" fun
I'd be more interested in supporting the "key" function:
any(users, key=User.is_admin)
As opposed to:
any(user.is_admin() for user in users)
1.8.2017 16.07 "Louie Lu" kirjoitti:
Hi all,
In "min" and "max" builtin-func, it support two style of args:
min(...)
min(iterable, *[, def
On 1 August 2017 at 14:01, 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?
I don't see any particular reason why not, but is there a specific use
case for this or is it just a matter of consistency? Unlike max and
Hi all,
In "min" and "max" builtin-func, it support two style of args:
min(...)
min(iterable, *[, default=obj, key=func]) -> value
min(arg1, arg2, *args, *[, key=func]) -> value
But for "any" and "all", it only support iterable:
all(iterable, /)
Return True if bo
10 matches
Mail list logo