I want a statement that does nothing but can be used in places requiring a statement. Pass: http://docs.python.org/release/2.5.2/ref/pass.html
Edit: Just saw: How do
No. You don't have pass
or equivalent keyword. But you can write equivalent code without any such keyword.
def f():
pass
becomes
void f() {}
and
class C:
pass
becomes
class C {};
In different context, different syntax could be useful. For example,
class MyError(Exception):
pass
becomes
class MyError : public std::exception
{
using std::exception::exception; //inherits constructor!
};
As you can see, in this context, you've to write using
to inherits constructors from the base class. In Python, pass
does the similar thing, in similar context.
Hope that helps.