Gustavo Niemeyer: <niemeyer at conectiva.com> > Looking again, this is true for any operation, not only > Py_EQ or Py_NE. CVS has previously restricted the shortcut to those two, but I agree it should be all or nothing. Even unordered objects normally compare equal to themselves; if "is" does not imply "__eq__", then we are by definition dealing with an exceptional case. (NaN, or SQL NULL, or DUMMY, or ...) Since different exceptional cases will have different rules, it might be reasonable to ask the creator to use a custom comparison function. They will often have to do this anyway. Instead of if (a == b): they can write if (a is not NULL) and (a == b): or if (a == b) and (not isNaN(a)): -jJ
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4