Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
from abc import ABC, abstractmethod
class AbstractThing(ABC):
@classmethod
@abstractmethod
def classy(cls):
...
@classmethod
@property
@abstractmethod
def class_proppy(cls):
...
@abstractmethod
def selfy(self):
...
@property
@abstractmethod
def self_proppy(self):
...
class ConcreteThing(AbstractThing):
@classmethod
def classy(cls):
print("classy")
@classmethod
@property
def class_proppy(cls):
print("class_proppy")
def selfy(self):
print("selfy")
@property
def self_proppy(self):
print("proppy")
c = ConcreteThing()
c.classy()
c.class_proppy
c.selfy()
c.self_proppy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment