Python doesn't have multiline lambdas, so there is no way to create an api similar to rake's:<p><pre><code>  task :name do |t|
   # do stuff
  end
</code></pre>
I'm not sure what's the closest equivalent syntax you could create in python.