def __new__(cls, name):
    """
        Create a new symbol instance.

        If the name was already used in another symbol then that object is
        returned directly. If the name was not used before then construct a new
        Symbol instance and return it.
        """
    try:
        return cls.__symbols[name]
    except KeyError:
        symbol = object.__new__(cls)
        cls.__symbols[name] = symbol
        return symbol
