Guido: > [MAL] > > One thing that would probably be implementable is a way to > > maintain "instance" dictionaries for types > But this would require an extra pointer field for *all* built-in > types. Ruby has an interesting solution to this. It keeps such "extra" instance variables in a global data structure. The Python version of this would be to have a special global dict which maps instances of built-in types to dicts holding their extra instance variables. The keys in this dict would have to be weak references, so that they wouldn't keep the objects alive. A flag would be set in the object header so that, when the object was deleted, the corresponding entry in the global dict could be cleaned up. The overhead would then be one bit in each object, and one extra test when deleting an object. Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg@cosc.canterbury.ac.nz +--------------------------------------+
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