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

    a = Attribute(type=int)

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

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

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

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

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

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

            bar = Attribute()