How to define a function with an empty body?

Hendrik van Rooyen hendrik at microcorp.co.za
Sun Sep 13 06:16:37 EDT 2009


On Sunday 13 September 2009 05:37:01 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?

def rubbish_do_nothing():
     pass

- Hendrik




More information about the Python-list mailing list