[Python-ideas] Add "equal" builtin function

Filipp Bakanov filipp at bakanov.su
Thu Oct 6 09:45:01 EDT 2016


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 (
http://stackoverflow.com/questions/3844801/check-if-all-elements-in-a-list-are-identical)
- all suggestions are either slow or not very elegant.
What do you think about it?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20161006/6b241623/attachment.html>


More information about the Python-ideas mailing list