Example #1
0
class ITest(Opaque):
    """A docstring"""

    a = Attribute(type=int)

    def b():
        pass
Example #2
0
class IFoo(Opaque):
    foo = Attribute()  # Initially set to 1 in implementations
Example #3
0
class IAttributeTypeB(Opaque):

    x = Attribute(type=TypeB)
Example #4
0
class IAttributeTypeA(IAttributeString):

    x = Attribute(type=TypeA)
Example #5
0
 class SubInterface(IAttributeTypeA, IAttributeTypeB):
     x = Attribute(type=TypeB)  # not subclass of TypeA
Example #6
0
 class SubInterface(IAttributeTypeA, IAttributeTypeB):
     x = Attribute(type=AString)  # fails - not subclass of both
Example #7
0
class IAttributeString(Opaque):

    x = Attribute(type=str)
Example #8
0
 class IAttributeWrongType(IAttributeString):
     x = Attribute(type=int)
Example #9
0
class IFoo(Opaque):

    foo = Attribute()
Example #10
0
        class MyInterface(Opaque):

            def foo(self):
                """A method."""

            bar = Attribute()