In the documentation the statement pass
is defined
pass
is a null operation. When executed, nothing happens. It is useful as a placeholder when syntactically a statement is required, but no code needs to be executed.
That's it, it's useful when I have something like this:
if aprovou_pagamento(p):
pass
# TODO(efetivar transação)
else:
desefetivar_transacao(p.transacao)
as this would generate a syntax error:
if aprovou_pagamento(p):
# TODO(efetivar transação)
else:
desefetivar_transacao(p.transacao)
Otherwise, I can not see any practical application, except under these conditions.
Are there other applications for pass
? In what other contexts would it be useful?