Python 2.0

Darrell news at dorb.com
Wed Jun 2 23:33:28 CEST 1999


Stidolph, David <stidolph at origin.ea.com> wrote in message
news:11A17AA2B9EAD111BCEA00A0C9B4179301E10ED6 at forest.origin.ea.com...
> >OK, I'll try to propose something constructive. Maybe we need an object
> >protocol, that would enumerate
> >all references held by an object ?  Writing a portable GC would be then
> much
> >easier.
>
> Sounds good to me for debugging.  A call that could return a list of
> everything that holds a reference to an object - that would be cool!
>
This would be very useful.
When I've needed this, I didn't want to see everything in the system.
In an effort to avoid performance problems and major changes.
Insert a soon to be designed trace object as a member of the instance you
want to trace. It captures file/line number ...
Haven't I seen this sort of thing here before ?

For those times when you have no idea where to begin.
sys.settrace could be used in some way to watch everything. Slowly yes.

The output could be analyzed for cyclic references. Run this like a lint.
Now that you've found the cycles could some code be auto generated to handle
the clean up ?

--
--Darrell






More information about the Python-list mailing list