Deprecating reload() ???

Skip Montanaro skip at pobox.com
Mon Mar 15 06:49:58 EST 2004


    Dave> Maybe we could somehow switch off the generation of shared objects
    Dave> for modules in a 'debug' mode.

You'd have to disable the integer free list.  There's also code in
tupleobject.c to recognize and share the empty tuple.  String interning
could be disabled as well.  Everybody's ignored the gorilla in the room:

    >>> sys.getrefcount(None)
    1559

In general, I don't think that disabling immutable object sharing would be
worth the effort.  Consider the meaning of module level integers.  In my
experience they are generally constants and are infrequently changed once
set.  Probably the only thing worth tracking down during a super reload
would be function, class and method definitions.

Skip




More information about the Python-list mailing list