[Python-ideas] Add "equal" builtin function
אלעזר
elazarg at gmail.com
Thu Oct 6 10:56:22 EDT 2016
On Thu, Oct 6, 2016 at 5:53 PM Sjoerd Job Postmus <sjoerdjob at sjoerdjob.com>
wrote:
> On Thu, Oct 06, 2016 at 02:45:11PM +0000, אלעזר 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, 2, 3]` and people often don't notice the need to write
> it.
> >
> > (I'd like to note that it makes sense for this operation to be written as
> >
> > *iter1 == *lst
> >
> > although it requires a significant change to the language, so a
> > Sequence.equal function makes sense)
> >
> > Elazar
> >
>
> I think you're mistaken about the suggestion.
You are right of course. Sorry.
Elazar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20161006/120e6553/attachment.html>
More information about the Python-ideas
mailing list