def __new__(cls, obo_name, *args, **kwargs):
        """Create a relationship or returning an already existing one.

        This allows to do the following:

            >>> Relationship('has_part').direction
            u'topdown'

        The Python syntax is overloaded, and what looks like a object
        initialization in fact retrieves an existing object with all its
        properties already set. The Relationship class behaves like a
        factory of its own objects !

        Todo:
            * Add a warning for unknown relationship (the goal being to
              instantiate every known ontology relationship and even
              allow instatiation of file-defined relationships).

        """
        if obo_name in cls._instances:
            return cls._instances[obo_name]
        else:
            return super(Relationship, cls).__new__(cls)
def __new__ ( cls , obo_name , * args , ** kwargs ) : if obo_name in cls . _instances : return cls . _instances [ obo_name ] else : return super ( Relationship , cls ) . __new__ ( cls )
Create a relationship or returning an already existing one.

        This allows to do the following:

            >>> Relationship('has_part').direction
            u'topdown'

        The Python syntax is overloaded, and what looks like a object
        initialization in fact retrieves an existing object with all its
        properties already set. The Relationship class behaves like a
        factory of its own objects !

        Todo:
            * Add a warning for unknown relationship (the goal being to
              instantiate every known ontology relationship and even
              allow instatiation of file-defined relationships).