def forget_canvas(canvas):
 cc = [c() for c in canvasses if (c() is not None)]
 while (canvas in cc):
  cc.remove(canvas)
 canvasses[:] = [weakref.ref(c) for c in cc]

def forget_canvas ( canvas ) : cc = [ c ( ) for c in canvasses if ( c ( ) is not None ) ] while ( canvas in cc ) : cc . remove ( canvas ) canvasses [ : ] = [ weakref . ref ( c ) for c in cc ]
forget about the given canvas .