def __init__(self, stream=None):
        """
        Creates a new `ClassTracker` object.

        :param stream: Output stream to use when printing statistics via
            ``stats``.
        """
        # Dictionaries of TrackedObject objects associated with the actual
        # objects that are tracked. 'index' uses the class name as the key and
        # associates a list of tracked objects. It contains all TrackedObject
        # instances, including those of dead objects.
        self.index = {}

        # 'objects' uses the id (address) as the key and associates the tracked
        # object with it. TrackedObject's referring to dead objects are replaced
        # lazily, i.e. when the id is recycled by another tracked object.
        self.objects = {}

        # List of `Snapshot` objects.
        self.snapshots = []

        # Keep objects alive by holding a strong reference.
        self._keepalive = []

        # Dictionary of class observers identified by classname.
        self._observers = {}

        # Thread object responsible for background monitoring
        self._periodic_thread = None

        self._stream = stream
def __init__ ( self , stream = None ) : self . index = { } self . objects = { } self . snapshots = [ ] self . _keepalive = [ ] self . _observers = { } self . _periodic_thread = None self . _stream = stream
Creates a new `ClassTracker` object.

        :param stream: Output stream to use when printing statistics via
            ``stats``.