def implementsOnly(*interfaces):
    """Declare the only interfaces implemented by instances of a class

        This function is called in a class definition (Python 2.x only).

        The arguments are one or more interfaces or interface
        specifications (IDeclaration objects).

        Previous declarations including declarations for base classes
        are overridden.

        This function is provided for convenience. It provides a more
        convenient way to call classImplementsOnly. For example::

          implementsOnly(I1)

        is equivalent to calling::

          classImplementsOnly(I1)

        after the class has been created.

        Consider the following example (Python 2.x only)::

          class C(A, B):
            implementsOnly(I1, I2)


        Instances of ``C`` implement ``I1``, ``I2``, regardless of what
        instances of ``A`` and ``B`` implement.
        """
