>>> import gc >>> a = 'abc' >>> a in gc.get_objects() False >>> a = Exception() >>> a in gc.get_objects() True >>>