[Python-ideas] Add "equal" builtin function

Ethan Furman ethan at stoneleaf.us
Thu Oct 6 11:39:33 EDT 2016


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 popular problem, there is a discussion of how to
> perform it on stackoverflow - all suggestions are either slow
>  or not very elegant.
>
> What do you think about it?

I don't know if it's common enough to warrant being a built-in, but I know I've needed it several times, and wrote my own.

--
~Ethan~


More information about the Python-ideas mailing list