Skip to content

Instantly share code, notes, and snippets.

@ferndot
Created December 14, 2017 00:40
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 ferndot/8c65e7716c6e5d88fde309933ff8ae5b to your computer and use it in GitHub Desktop.
Save ferndot/8c65e7716c6e5d88fde309933ff8ae5b to your computer and use it in GitHub Desktop.
class Goal(object):
name = 'Generic Goal'
@classmethod
def getConcreteClasses(cls):
for c in cls.__subclasses__():
yield c
for c2 in c.getConcreteClasses():
yield c2
def progress(self):
return self.completed / self.total
class InfluenceGoal(Goal):
name = 'Influence Goal'
def progress(self):
return self.completed / self.total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment