News for hackers. Stuff that matters.
Re:The PEPs of Python 3.9 by joppy on Friday May 29, 2020 @01:52AM (#23346659)
What is the rationale behind this? '==' works all the time, and 'is' only works sometimes. Using 'is' wherever possible requires the user to know some rather arbitrary language details (which objects are singletons and which are not), wheras '==' will always give the correct answer regardless.
Re:The PEPs of Python 3.9 by pansa2 on Friday May 29, 2020 @02:41AM (#23346917)
Classes can overload `==`:

    class C:
        def __eq__(self, other):
            return True

    print(C() == None)  # True
    print(C() is None)  # False