On Sun, Sep 13, 2009 at 3:12 PM, Peng Yu <pengyu...@gmail.com> wrote: > Hi, > > I want to understand why python use indentation to denote block of > code. What are the advantages of it?
See the FAQ: http://www.python.org/doc/faq/general/#why-does-python-use-indentation-for-grouping-of-statements > Is there a style in python to > denote a block of code the same as that of C++ (with '{}')? No. > One disadvantage of using indentation to denote a block of code is > that the runtime to automatically indent a python code would be about > a few times more than the runtime to automatically indent a C++ code > of the same length (both are in vim). In fact it's pretty much impossible to automatically indent Python code that has had its indentation removed; it's impossible to know for sure where the dedents should occur. Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list