1

I just wondering is it possible to make something like this:

class Base:
    __interface__ = BaseInterface        

    @classmethod
    @property
    def interface(cls):
        return cls.__interface__(cls)

The goal is to have some interface available both as static and instance variable. But the problem is that this interface should be initialized on class constructor.

martineau
  • 112,593
  • 23
  • 157
  • 280
Eugene Tsakh
  • 2,645
  • 2
  • 13
  • 26
  • 1
    I think the duplicate should answer your question. If it doesn't please [edit] your question and explain **why it doesn't solve your problem** so it can be reopened. – MSeifert Mar 25 '17 at 14:29

0 Answers0