News for hackers. Stuff that matters.
Re:Denied: Python Micro-Framework (Sinatra-like) by csytan on Friday April 02, 2010 @05:28PM (#1237624)
This is commonly used in python modules which can also be run by command line.

http://effbot.org/pyfaq/tutor-what-is-if-name-main-for.htm

I do agree though, it would be better to remove the if statement altogether since it's unlikely to be imported as a module.

Re:Denied: Python Micro-Framework (Sinatra-like) by the_mitsuhiko on Friday April 02, 2010 @05:55PM (#1237680)
Well, the run() function was intended to be a very bad example of API. Because there is that magical application object you never see that run magically picks up.

There is another example of really bad API in denied: there is a template render function internally (you have to read the code behind the code to see that) which magically accepts both filenames for templates and template source strings. And there are a couple of more examples of really, really bad ideas in that code.