[Python-ideas] Compact repr operator (i.e., __short_repr__)

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Feb 8 23:19:44 EST 2016


Mahmoud Hashemi wrote:
> I was curious if what kind of interest there would be in adding an 
> overridable method to types to allow getting back a repr, but a 
> predictably short one.

If you just want to know the type and identity of an object,
you can use object.__repr__(x).

-- 
Greg


More information about the Python-ideas mailing list