|
@@ -13,15 +13,16 @@ class Diff:
|
|
|
def __init__(self, lost, gained):
|
|
def __init__(self, lost, gained):
|
|
|
self.lost=lost
|
|
self.lost=lost
|
|
|
self.gained=gained
|
|
self.gained=gained
|
|
|
- def printOut(self):
|
|
|
|
|
|
|
+ def printOut(self, full=False):
|
|
|
print 'lost %s objects, gained %s objects' % (len(self.lost), len(self.gained))
|
|
print 'lost %s objects, gained %s objects' % (len(self.lost), len(self.gained))
|
|
|
print '\n\nself.lost\n'
|
|
print '\n\nself.lost\n'
|
|
|
print self.lost.typeFreqStr()
|
|
print self.lost.typeFreqStr()
|
|
|
print '\n\nself.gained\n'
|
|
print '\n\nself.gained\n'
|
|
|
print self.gained.typeFreqStr()
|
|
print self.gained.typeFreqStr()
|
|
|
- self.gained.printObjsByType()
|
|
|
|
|
- print '\n\nGAINED-OBJECT REFERRERS\n'
|
|
|
|
|
- self.gained.printReferrers(1)
|
|
|
|
|
|
|
+ if full:
|
|
|
|
|
+ self.gained.printObjsByType()
|
|
|
|
|
+ print '\n\nGAINED-OBJECT REFERRERS\n'
|
|
|
|
|
+ self.gained.printReferrers(1)
|
|
|
|
|
|
|
|
class ObjectPool:
|
|
class ObjectPool:
|
|
|
"""manipulate a pool of Python objects"""
|
|
"""manipulate a pool of Python objects"""
|
|
@@ -102,7 +103,9 @@ class ObjectPool:
|
|
|
print '\n============================'
|
|
print '\n============================'
|
|
|
counts = list(set(self._count2types.keys()))
|
|
counts = list(set(self._count2types.keys()))
|
|
|
counts.sort()
|
|
counts.sort()
|
|
|
- counts.reverse()
|
|
|
|
|
|
|
+ # print types with the smallest number of instances first, in case
|
|
|
|
|
+ # there's a large group that waits a long time before printing
|
|
|
|
|
+ #counts.reverse()
|
|
|
for count in counts:
|
|
for count in counts:
|
|
|
types = makeList(self._count2types[count])
|
|
types = makeList(self._count2types[count])
|
|
|
for typ in types:
|
|
for typ in types:
|