The OP added a cute example to http://python.org/sf/625698 It's a recursive object that should compare equal to itself if and only if it does not compare equal to itself -- the Russell's Paradox of Python comparisons. As things stand, whether a==a (for this object) returns True or False depends on the parity (odd or even) of object.c's NESTING_LIMIT. I vote "give up". The graph isomorphism business is cute but has no practical application I've ever seen. Even without the paradoxes, the 2-element list example takes about 4 seconds to return True now, and I estimate a 3-element list would take 3-4 hours, and a 4-element list about 48 days. Python isn't checking for KeyboardInterrupt during this, so killing the process is the only way to stop it. I'd rather raise a "can't compare recursive objects" exception as soon as recursion is detected.
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