On 11/08/2014 13:30, alister wrote:
It already is a different operator from equality which is ==
perhaps it would have been better if the behaviour of these two operators
were reversed (= for equality & == for assignment) but i suspect that
Idea if even considered was quickly discarded as it would cause major
confusion to programmers who work with multiple languages
Of course Python can be even more confusing so that for example
>>> class NeverEqual(int):
... def __new__(cls,v):
... self = int.__new__(cls,v)
... return self
... def __eq__(self,other):
... return False
...
>>> a=NeverEqual(1)
>>> a
1
>>> a==1
False
>>> a==a
False
>>> not (a != a)
True
>>> a!=a
False
>>>
so I think that assignment doesn't always make things equal even
chronologically.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list