May 2, 2022
6:21 a.m.
01.05.22 19:32, Guido van Rossum пише:
Non should behave as closely as possible to it not being defined at all. So return NotImplemented.
But, as was noted by Spencer Brown, it is not how it works for __iter__(), __reversed__() and __contains__() (which have a special path for producing explicit error), and not how it currently works for __add__() and __eq__() (although they raise TypeError implicitly). It is all documented inhttps://docs.python.org/3.10/reference/datamodel.html#id2 If we are going to reconsider this, it is a large breaking change.