selfdescribing.py 574 B

123456789101112131415161718
  1. __author__ = "Jon Reid"
  2. __copyright__ = "Copyright 2011 hamcrest.org"
  3. __license__ = "BSD, see License.txt"
  4. class SelfDescribing(object):
  5. """The ability of an object to describe itself."""
  6. def describe_to(self, description):
  7. """Generates a description of the object.
  8. The description may be part of a description of a larger object of
  9. which this is just a component, so it should be worded appropriately.
  10. :param description: The description to be built or appended to.
  11. """
  12. raise NotImplementedError('describe_to')