[Python-3000] gc, timestamping

Jim Jewett jimjjewett at gmail.com
Wed Jan 24 19:42:27 CET 2007


(on python-dev) Kristján V. Jónsson wrote:

> We have been using gc.get_objects() but it has several problems:
>  1) ... results in a list so long that it often kills the system.

In Py3K, should this also return an iterator, rather than a list?

In other words, is the dict.items change something specific to dicts,
or something that could happen with any large sequence?

> 2) There is no way to frame certain operations and get just those
> objects that were created during their execution.  ... storing the id()s of all objects
>... the ambiguity of id() in the face of objects being created and destroyed.

Changing id() to be something other than the address probably isn't
practical, but with the elimination of old-style classes, everything
should inherit from object.  Would it make sense to add optional
timestamping (or other alternative id-like attributes)?

Right now, the best solution I see is to use a debug build and a C
debugger to inspect the serial number that _PyObject_DebugMalloc
sticks after its FORBIDDENBYTE barrier.

-jJ


More information about the Python-3000 mailing list