def __str__(self): """K objects are printed the way k would print them >>> print k('(1 ; 2 3; "abc")') (1 2 3 "abc") """ return _K.__repr__(self)
def __repr__(self): """returns a representation of the K object which can be evaluated by Python""" r = _K.__repr__(self) if '\n' in r or '"' in r: return 'k(""" ' + r + ' """)' return 'k("' + r + '")'