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
  • 119,623
  • 25
  • 170
  • 301
Eugene Tsakh
  • 2,777
  • 2
  • 14
  • 27
  • 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