Next / Previous / Contents / Shipman's homepage

8.2. Rank.__str__()

This method displays a Rank instance as a string. It is useful in debugging.

xnomo3.py
# - - -   R a n k . _ _ s t r _ _   - - -

    def __str__ ( self ):
        """Return self as a string."""
        return ( "%2d %-2s %s (keyLen %d, optional %d)" %
                 ( self.depth, self.code, self.name, self.keyLen,
                   self.isOptional ) )