The following causes some additional strange output to be printed
import warnings
def foo(x):
if x > 100:
msg = "Warning! x is big!"
warnings.warn(msg)
return True
foo(999999)
Instead of only printing:
UserWarning: Warning! x is big!
we get:
UserWarning: Warning! x is big!
warnings.warn(msg)
Sometimes I have even gotten:
UserWarning: Warning! x is big!
ValueError [blah, blah, blah]