1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
>>> result.append('start')
Default reason:
.. skip: next if(2 > 1)
Should not run:
>>> result.append('bad 1')
>>> result.append('good 1')
.. skip: start if(2 > 1, reason='foo')
>>> result.append('bad 2')
>>> result.append('bad 3')
.. skip: end
>>> result.append('good 2')
Here's a really extreme example of computing the reason from stuff in the namespace:
.. skip: next if (True, 'good reason' if result[-1] == 'good 2' else 'bad reason' )
>>> result.append('bad 4')
|