Skip to content

Instantly share code, notes, and snippets.

@Arcensoth
Created September 13, 2021 14:18
Show Gist options
  • Save Arcensoth/b85099fa2f668f27d1736cf342a5f0fc to your computer and use it in GitHub Desktop.
Save Arcensoth/b85099fa2f668f27d1736cf342a5f0fc to your computer and use it in GitHub Desktop.
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