4
In the documentation the statement pass
is defined
pass
is a null operation. When executed, nothing happens. Useful as a placeholder when syntactically a statement is required, but no code needs to be executed.
That is, it’s useful when I have something like this:
if aprovou_pagamento(p):
pass
# TODO(efetivar transação)
else:
desefetivar_transacao(p.transacao)
because this would generate a syntax error:
if aprovou_pagamento(p):
# TODO(efetivar transação)
else:
desefetivar_transacao(p.transacao)
Otherwise, I can’t see any practical application, except under these conditions.
There are other applications for pass
? In what other contexts it would be useful?
Related: What is the real usefulness of the pass in this case?
– Woss