sentinel.py 421 B

1234567891011121314151617
  1. """Sentinel class for constants with useful reprs"""
  2. # Copyright (c) IPython Development Team.
  3. # Distributed under the terms of the Modified BSD License.
  4. class Sentinel(object):
  5. def __init__(self, name, module, docstring=None):
  6. self.name = name
  7. self.module = module
  8. if docstring:
  9. self.__doc__ = docstring
  10. def __repr__(self):
  11. return str(self.module)+'.'+self.name