def __eq__(self, other):
        """Compare this signature with another.

        The behavior of this operator depends on the types of the arguments. If both :py:`self`
        and :py:`other` are instances of the base :class:`Signature` class, they are compared
        structurally (the result is :py:`self.members == other.members`); otherwise they are
        compared by identity (the result is :py:`self is other`).

        Subclasses of :class:`Signature` are expected to override this method to take into account
        the specifics of the domain. If the subclass has additional properties that do not influence
        the :attr:`members` dictionary but nevertheless make its instance incompatible with other
        instances (for example, whether the feedback is combinational or registered),
        the overridden method must take that into account.

        Returns
        -------
        :class:`bool`
        """
        other_unflipped = other.flip() if type(other) is FlippedSignature else other
        if type(self) is type(other_unflipped) is Signature:
            # If both `self` and `other` are anonymous signatures, compare structurally.
            return self.members == other.members
        else:
            # Otherwise (if `self` refers to a derived class) compare by identity. This will
            # usually be overridden in a derived class.
            return self is other
Compare this signature with another.

        The behavior of this operator depends on the types of the arguments. If both :py:`self`
        and :py:`other` are instances of the base :class:`Signature` class, they are compared
        structurally (the result is :py:`self.members == other.members`); otherwise they are
        compared by identity (the result is :py:`self is other`).

        Subclasses of :class:`Signature` are expected to override this method to take into account
        the specifics of the domain. If the subclass has additional properties that do not influence
        the :attr:`members` dictionary but nevertheless make its instance incompatible with other
        instances (for example, whether the feedback is combinational or registered),
        the overridden method must take that into account.

        Returns
        -------
        :class:`bool`
        
amaranth/lib/wiring.py