M.-A. Lemburg wrote: > Well, the strings and integers count twice: once in the module > namespace and once in the errorcode dictionary.
That shouldn't be the case: the strings are interned (as they are identifier-like), so you have the very same string object in both dictionaries. The numbers shouldn't be duplicated because they occur in the co_consts array of the global code object, and because the compiler should share them there. > Given that the code strings and integers are created > twice in my version of the module, the numbers sound about > right. If they are indeed created twice, something is wrong. > I agree that creating only one dictionary statically > and the other mapping dynamically will already be a > saving of 50% simply by sharing the string and integer > objects. No, they should be shared already, so that shouldn't save anything. Regards, Martin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com