On 6 October 2016 at 23:45, Filipp Bakanov wrote:
> For now there are many usefull builtin functions like "any", "all", etc. I'd
> like to propose a new builtin function "equal". It should accept iterable,
> and return True if all items in iterable are the same or iterable is emty.
If the items a
On 6 October 2016 at 18:09, Filipp Bakanov wrote:
> Seems like itertools recipes already have "all_equal" function. What do you
> think about moving it from recipes to itertools? I suggest a C
> implementation with optimisations for builtin collections.
Interestingly, the recipe given there was n
On 06/10/2016 15:43, Sjoerd Job Postmus wrote:
On Thu, Oct 06, 2016 at 03:01:36PM +0100, Paul Moore wrote:
On 6 October 2016 at 14:45, Filipp Bakanov wrote:
For now there are many usefull builtin functions like "any", "all", etc. I'd
like to propose a new builtin function "equal". It should ac
The name might be a little confusing; it can be understood as comparing two
sequences, so passing two sequences may seem reasonable to a reviewer.
Elazar
בתאריך יום ה׳, 6 באוק' 2016, 20:15, מאת Filipp Bakanov :
> Seems like itertools recipes already have "all_equal" function. What do
> you thin
Seems like itertools recipes already have "all_equal" function. What do you
think about moving it from recipes to itertools? I suggest a C
implementation with optimisations for builtin collections.
2016-10-06 18:42 GMT+03:00 Chris Angelico :
> On Fri, Oct 7, 2016 at 2:23 AM, Steven D'Aprano
> wr
On Fri, Oct 7, 2016 at 2:23 AM, Steven D'Aprano wrote:
> +0.3 to adding it the standard library.
>
> +0.1 to adding it to built-ins
>
> -0.1 on adding it to built-ins under the name "equal", as that will
> confuse too many people.
I'll go further: -0.5 on adding to built-ins. +0.5 on adding it to
On 10/06/2016 06:45 AM, Filipp Bakanov wrote:
For now there are many usefull builtin functions like "any", "all",
etc. I'd like to propose a new builtin function "equal". It should
accept iterable, and return True if all items in iterable are the
same or iterable is emty.
That's quite popula
On Thu, Oct 06, 2016 at 04:45:01PM +0300, Filipp Bakanov wrote:
> For now there are many usefull builtin functions like "any", "all", etc.
> I'd like to propose a new builtin function "equal". It should accept
> iterable, and return True if all items in iterable are the same or iterable
> is emty.
On Thu, Oct 6, 2016 at 5:53 PM Sjoerd Job Postmus
wrote:
> On Thu, Oct 06, 2016 at 02:45:11PM +, אלעזר wrote:
> > It is a real problem. People are used to write `seq == [1, 2, 3]` and it
> > passes unnoticed (even with type checkers) that if seq changes to e.g. a
> > tuple, it will cause subt
On Thu, Oct 06, 2016 at 02:45:11PM +, אלעזר wrote:
> It is a real problem. People are used to write `seq == [1, 2, 3]` and it
> passes unnoticed (even with type checkers) that if seq changes to e.g. a
> tuple, it will cause subtle bugs. It is inconvenient to write `len(seq) ==
> 3 and seq == [1
On Thu, Oct 06, 2016 at 03:01:36PM +0100, Paul Moore wrote:
> On 6 October 2016 at 14:45, Filipp Bakanov wrote:
> > For now there are many usefull builtin functions like "any", "all", etc. I'd
> > like to propose a new builtin function "equal". It should accept iterable,
> > and return True if all
It is a real problem. People are used to write `seq == [1, 2, 3]` and it
passes unnoticed (even with type checkers) that if seq changes to e.g. a
tuple, it will cause subtle bugs. It is inconvenient to write `len(seq) ==
3 and seq == [1, 2, 3]` and people often don't notice the need to write it.
(
On 6 October 2016 at 14:45, Filipp Bakanov wrote:
> For now there are many usefull builtin functions like "any", "all", etc. I'd
> like to propose a new builtin function "equal". It should accept iterable,
> and return True if all items in iterable are the same or iterable is emty.
> That's quite
For now there are many usefull builtin functions like "any", "all", etc.
I'd like to propose a new builtin function "equal". It should accept
iterable, and return True if all items in iterable are the same or iterable
is emty.
That's quite popular problem, there is a discussion of how to perform it
14 matches
Mail list logo