Next / Previous / Contents / TCC Help System / NM Tech homepage

26.3.19. __repr__(): String representation

If a class defines it, this special method is called to find the “representation” of an object. There are two ways to get a representation:

The calling sequence is:

    def __repr__(self):

The method returns the representation of self as a string.