def consts(t):
 for elt in t:
  r = repr(elt)
  if r.startswith('<code object'):
   (yield ('<code object %s>' % elt.co_name))
  else:
   (yield r)

def consts ( t ) : for elt in t : r = repr ( elt ) if r . startswith ( '<code object' ) : ( yield ( '<code object %s>' % elt . co_name ) ) else : ( yield r )
yield a doctest-safe sequence of object reprs .