pass
KeywordPython 2.0+Beginner
A no-op placeholder; does nothing, used where syntax requires a statement
Quick Info
- Documentation
- Official Docs
- Python Version
- 2.0+
Learn by Difficulty
Quick Example
python
# Empty class class NotImplementedYet: pass # Empty function def todo(): pass # Empty conditional branch x = 10 if x > 0: pass # will handle later else: print("negative") print(type(NotImplementedYet())) print(todo())
pass is a no-op statement. Python requires at least one statement in every block, so pass acts as a placeholder.
Try in PlaygroundTags
languagesyntaxcoreplaceholderno-op