6.4 The pass statement

pass_stmt ::= "pass"
Download entire grammar as text.

pass is a null operation -- when it is executed, nothing happens. It is useful as a placeholder when a statement is required syntactically, but no code needs to be executed, for example:

def f(arg): pass # a function that does nothing (yet)
class C: pass # a class with no methods (yet)


Python Reference Manual
Previous: Up: 6. Simple statements Next:

Release 2.5.2, documentation updated on 21st February, 2008.
See About this document... for information on suggesting changes.

AltStyle によって変換されたページ (->オリジナル) /