Skip to content

Instantly share code, notes, and snippets.

@beakr
Created March 1, 2014 18:56
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 beakr/9295281 to your computer and use it in GitHub Desktop.
Save beakr/9295281 to your computer and use it in GitHub Desktop.
Task running decorator.
tasks = []
def task(meth):
tasks.append(meth)
def new(*args): return meth(*args)
return new
def call_task(task_id):
(tasks[id])()
@task
def foo: 2 + 2
call_task(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment