Re: How to define a function with an empty body?

2009-09-13 Thread Hendrik van Rooyen
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

Re: How to define a function with an empty body?

2009-09-13 Thread Christian Heimes
Peng Yu schrieb: 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?

Re: How to define a function with an empty body?

2009-09-13 Thread Albert Hopkins
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

Re: How to define a function with an empty body?

2009-09-13 Thread David
Il Sat, 12 Sep 2009 22:37:01 -0500, Peng Yu ha scritto: Hi, I want to define a function without anything in it body. [...] I usually define void functions as: def myfunction(): raise NotImplementedError(You forgot to implement me!) so I keep safe from leaving orphaned functions

Re: How to define a function with an empty body?

2009-09-13 Thread Steven D'Aprano
On Sun, 13 Sep 2009 15:30:52 +0200, Christian Heimes wrote: Peng Yu schrieb: 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

How to define a function with an empty body?

2009-09-12 Thread Peng Yu
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() { } Regards, Peng

Re: How to define a function with an empty body?

2009-09-12 Thread Chris Rebert
On Sat, Sep 12, 2009 at 8:37 PM, Peng Yu pengyu...@gmail.com 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

Re: How to define a function with an empty body?

2009-09-12 Thread Mel
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?