Next / Previous / Contents / Shipman's homepage

7.9. Pt.__str__(): Represent as a string

homcoord.py
# - - -   P t . _ _ s t r _ _

    def __str__(self):
        '''Return a string representation of self.
        '''
        return "(%.4g, %.4g)" % self.xy()

    def __repr__(self):
        return str(self)