def __str__(self):
        text = '%s\n\n' % self.name
        text += _format_source_error(self.filename, self.context, self.lineno)
        text += "\n\n%s: global name '%s' " % (type(self).__name__, self.name)
        text += "is not defined"
        return text
A nicely formatted representaion of the exception.
dataset/ETHPy150Open ContinuumIO/ashiba/enaml/enaml/core/exceptions.py/DeclarativeNameError.__str__