[I wrote] > Maybe we can add even detect the abusing cases by putting a test in > PyString_InternInPlace() like this: > > if (s->ob_refcnt == 1) { > PyErr_Warn(PyExc_DeprecationWarning, > "interning won't keep your string alive"); > PyErr_Clear(); /* In case the warning was an error, ignore it */ > Py_INCREF(s); /* Make s immortal */ > } I tried this, and alas it doesn't work; there are many legit places where there's only one reference. So we'll have to use more traditional ways of tracking down C code that makes assumptions of immortality so it can drop its own reference. (Apart from getclassname() I've seen none.) --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