Skip to content

Instantly share code, notes, and snippets.

@cjhanks
Created January 10, 2014 21:43
Show Gist options
  • Save cjhanks/8363271 to your computer and use it in GitHub Desktop.
Save cjhanks/8363271 to your computer and use it in GitHub Desktop.
parent class
class Parent(object):
def method(self, *args, **kwargs):
raise NotImplementedError('NOT DONE')
@classmethod
def impl_method(Cls, data):
print(Cls, data)
class Child1(Parent):
def method(self, k):
return self.impl_method(k)
class Child2(Parent):
def method(self, k):
return self.impl_method(k)
c1 = Child1()
c2 = Child2()
c1.method(3)
c2.method(3)
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment