- pass is a keyword in Python.
- pass keyword constitutes a pass statement.
- pass denotes a null operation. Nothing happens when pass is executed.
- pass is not equivalent to a comment statement in Python.
- Unlike a comment statement a pass statement in Python is not ignored.
- In function blocks, method blocks, if blocks and for blocks - a Python developer can use a statement alone denoting the implementation of the block is to be done later.
- Blocks only with pass statements make the design intentions of the developer clear and explicit.
- A function or method with a pass statement returns None.
z = mean()
The above definition of function mean()is deferred with a pass statement.
print("translation done") # the real implementation will be much more
print("rotation done") # the real implementation will be much more
pass # adding two images is for sprint 2
imageObject = image()
# Test image operations
In the above example implementation rotation method of an image object is marked for sprint 2 and filled with a pass statement.