> > Modified Files: > > Tag: descr-branch > > object.c > > Log Message: > > Add _PyObject_GetDictPtr() -- an internal API to get a pointer to > > where __dict__ is stored in an object. The simplest case is to add > > tp_dictoffset to the start of the object, but there are comlications: > > tp_flags may tell us that tp_dictoffset is not defined, or the offset > > may be negative: indexing from the end of the object, where > > tp_itemsize may have to be taken into account. > > Why would you ever have a negative size in there? That seems like an > unnecessary "feature". The offsets are easily set up by the compiler as > positive values. (not even sure how you'd come up with a proper/valid > negative value) When extending a type like tuple or string, the __dict__ has to be added to the end, after the last item, because we can't change the starting offset of the first item. This is not at a fixed offset from the start of the structure. --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