Python pass Statement

The pass statement performs no action and serves as a placeholder in Python. It can be used when a statement is required syntactically but the program requires no action . Python has the syntactical requirement that code blocks after if, except, def, class etc. cannot be empty . The interpreter will produce IndentationError if the above mention code blocks are left empty. example
class test_class(object): def test_method_1(self): pass deftest_method_2(self): print "calling...me..."
In the example above, when the python interpreter encounters the pass statement , it simply continues with its execution as it normally would. If you would leave out the pass statement in test_method_1(), the code wouldn't run and you will get an IndentationError .
IndentationError: expected an indented block
The Python pass statement is a null operation; nothing happens as pass statement is executed and it just passes execution to the next statement . However, the interpreter reads it and so if placed in functions, if statement, loops etc. this is taken as a statement.