Example:
>>> from zope.interface import Interface, Attribute
>>> class IA(Interface):
... foo = Attribute("foo")
...
>>> IA.names()
['foo']
>>> class IB(IA):
... bar = Attribute("bar")
...
>>> IB.names()
['bar']
How can I have IB.names() return the attributes defined in IA as well?
If you take a look at the
zope.interface.interfaces
module you'll find that theInterface
class has aIInterface
interface definition! It documents thenames
method as follows:To thus expand on your example: