def __new__(cls, *args, **kwargs): try: exception = kwargs["exception"] error_cls = type(xstr(exception), (cls,), {}) except KeyError: error_cls = cls return Exception.__new__(error_cls, *args)
def type(name): """ Return the :class:`.Relationship` subclass corresponding to a given name. :param name: relationship type name :returns: `type` object """ for s in Relationship.__subclasses__(): if s.__name__ == name: return s return type(xstr(name), (Relationship, ), {})
def __repr__(self): return xstr(cypher_repr(self))