On Thu, May 07, 2020 at 04:42:22PM +0100, Rhodri James wrote: > On 07/05/2020 10:11, Steven D'Aprano wrote:
> The biggest argument against a second "equals" operator, however it is > spelt, is confusion. Which of these two operators do I want to use for > this subtly different question of equality? Even where we have quite > distinct concepts like "==" and "is", people still get muddled. If we > have "==" and "=OMG=" or whatever, that would just be an accident > waiting to happen. I don't think so. The confusion with `is` is particularly acute for at least two reasons: - in regular English it can be a synonym for equals, as in "one and one is two, two and two is four"; - it seems to work sometimes: `1 + 1 is 2` will probably succeed. If the operator was named differently, we probably wouldn't have many people writing `1 + 1 idem 2` or `1 + 1 dasselbe 2` when they wanted equality. I doubt many people would be confused whether they wanted, let's say, the `==` operator or the `same_items` operator, especially if `1 + 1 same_items 2` raised a TypeError. -- Steven _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/QCPAXCTZD3MAAJR7CFI7UXJHXH25B22Y/ Code of Conduct: http://python.org/psf/codeofconduct/
