News for hackers. Stuff that matters.
Re:Code blocks in Python by wslh on Friday April 20, 2012 @09:31AM (#3867773)
If the code block can run in a different thread (like in Grand Central Dispatch) it is very useful to do stuff in the background without blocking the GUI (that executes in a specific thread) and using the current scope variables. A progress bar is a clear example of this.

Doing this without code blocks adds extra code like launching another thread, connecting the scope to the new thread.

Re:Code blocks in Python by lee on Friday April 20, 2012 @09:53AM (#3867858)
Sorry, I'm not following. Why couldn't you use a function here instead of a code block to do the exact same thing?