> Speaking of graceful approaches, I expect that this code: > > (v->ob_type->tp_as_mapping > || (v->ob_type->tp_as_sequence > && !PyString_Check(v) > && !PyTuple_Check(v)))) { > > no longer does what it intended to do for tuples. Tuples can't be > recursive, Oh yes they can be: >>> L = [] >>> t = (L, L) >>> L.append(L) >>> > so it intended to exempt tuples from the recursive-compare > machinery. But Michael Hudson added a non-NULL tp_as_mapping slot to tuples > in rev 2.65 of tupleobject.c, so tuples are no longer exempted by the > recursive-compare gimmick. That makes the problem in 2.3 worse than it used > to be (although it's never been zippy, due to clearing inprogress dict > entries while they're still potentially useful). So all the hacks I added > (in my ugly patch) to keep check_recursion's tuple operations out of this > code would be better done by restoring the "don't look at tuples at all" > intent of the code above. --Guido van Rossum (home page: http://www.python.org/~guido/)
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