class ITest(Opaque): """A docstring""" a = Attribute(type=int) def b(): pass
class IFoo(Opaque): foo = Attribute() # Initially set to 1 in implementations
class IAttributeTypeB(Opaque): x = Attribute(type=TypeB)
class IAttributeTypeA(IAttributeString): x = Attribute(type=TypeA)
class SubInterface(IAttributeTypeA, IAttributeTypeB): x = Attribute(type=TypeB) # not subclass of TypeA
class SubInterface(IAttributeTypeA, IAttributeTypeB): x = Attribute(type=AString) # fails - not subclass of both
class IAttributeString(Opaque): x = Attribute(type=str)
class IAttributeWrongType(IAttributeString): x = Attribute(type=int)
class IFoo(Opaque): foo = Attribute()
class MyInterface(Opaque): def foo(self): """A method.""" bar = Attribute()