News for hackers. Stuff that matters.
Re:What Pythonistas Think of Ruby by tsuraan on Wednesday February 03, 2010 @10:43AM (#1097930)
Python's answer to blocks tends to be the with statement, so your example would look like

  with task('name') as t:
    # do stuff with t
It's not really the same; the task object doesn't have control over whether the block is actually run, but sometimes it is sufficient.
Re:What Pythonistas Think of Ruby by fuzzyman on Wednesday February 03, 2010 @11:01AM (#1097985)
You could almost certainly achieve that with the implementation of blocks provided by this package:

http://pypi.python.org/pypi/withhacks/

Re:What Pythonistas Think of Ruby by tsuraan on Wednesday February 03, 2010 @11:27AM (#1098062)
Wow, I've never seen that before. I'm also not sure I'd say a solution that uses bytecode rewriting is really working within the language, but that's a pretty interesting package anyhow.
Re:What Pythonistas Think of Ruby by fuzzyman on Wednesday February 03, 2010 @12:10PM (#1098209)
Well, normally I would agree - but if its entirely abstracted away in a library (and the library is well written) then it might sort-of-kind-of-maybe be ok.

Python itself does varying degrees of bytecode optimisation depending on which version you're using.

Re:What Pythonistas Think of Ruby by bad_user on Wednesday February 03, 2010 @11:16AM (#1098038)
that's cool, thanks ... I was wondering about that