Skip to content

Instantly share code, notes, and snippets.

@hazelement
Last active September 13, 2018 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hazelement/f721b0d830ed626dd34357405a336900 to your computer and use it in GitHub Desktop.
Save hazelement/f721b0d830ed626dd34357405a336900 to your computer and use it in GitHub Desktop.
Python class
# python 2
from abc import abstractmethod, ABCMeta
ABC = ABCMeta('ABC', (object,), {'__slots__': ()})
class AbstractClassExample(ABC):
@abstractmethod
def do_something(self):
pass
# python 3
from abc import ABC, abstractmethod
class AbstractClassExample(ABC):
@abstractmethod
def do_something(self):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment