On Sat, 2009-09-12 at 22:37 -0500, Peng Yu wrote: > Hi, > > I want to define a function without anything in it body. In C++, I can > do something like the following because I can use "{}" to denote an > empty function body. Since python use indentation, I am not sure how > to do it. Can somebody let me know how to do it in python? > > void f() { > } >
Surprised no one has mentioned this yet, but since it's a function, and in python all functions return values (whether explicitly or implicitly, a simple "return" works and, to me, does much more to inform the reader that "this function does nothing". def f(): return -- http://mail.python.org/mailman/listinfo/python-list