def track_closed(cls):
 class TrackingClosed(cls, ):
  def __init__(self, *a, **kw):
   super(TrackingClosed, self).__init__(*a, **kw)
   self.closed = False
  def close(self):
   super(TrackingClosed, self).close()
   self.closed = True
 return TrackingClosed

def track_closed ( cls ) : class TrackingClosed ( cls , ) : def __init__ ( self , * a , ** kw ) : super ( TrackingClosed , self ) . __init__ ( * a , ** kw ) self . closed = False def close ( self ) : super ( TrackingClosed , self ) . close ( ) self . closed = True return TrackingClosed
wraps a queue class to track down if close() method was called .