This Python example page explains the use of the pass statement to indicate empty functions, classes and loops.
Pass. Time passes. And often nothing happens. In Python we use the "pass" keyword (a statement) to indicate that nothing happens—the function, class or loop is empty.
With pass, we indicate a "null" block. Pass can be placed on the same line, or on a separate line. Pass can be used to quickly add things that are unimplemented.
Method example. Here we use the "pass" statement on two methods. These methods do nothing. But they can be called in Python code.
Result: Nothing happens when the pass methods are called. The pass can be used in other places in Python programs.
Pass. Time passes. And often nothing happens. In Python we use the "pass" keyword (a statement) to indicate that nothing happens—the function, class or loop is empty.
With pass, we indicate a "null" block. Pass can be placed on the same line, or on a separate line. Pass can be used to quickly add things that are unimplemented.
Method example. Here we use the "pass" statement on two methods. These methods do nothing. But they can be called in Python code.
Result: Nothing happens when the pass methods are called. The pass can be used in other places in Python programs.