It appears this behavior is an artifact of having %autocall turned on -- turning it off makes it behave "correctly".
Apparently, someone was aware of the behavior given this comment in the LineInfo::ofind method defined in prefilter.py:
Note: can cause state changes because of calling getattr, but should
only be run if autocall is on and if the line hasn't matched any
other, less dangerous handlers.
At any rate, I think this behavior is questionable. At a minimum it should be documented in %autocall? so users understand the risks of having it enabled.
It appears this behavior is an artifact of having %autocall turned on -- turning it off makes it behave "correctly".
Apparently, someone was aware of the behavior given this comment in the LineInfo::ofind method defined in prefilter.py:
Note: can cause state changes because of calling getattr, but should
only be run if autocall is on and if the line hasn't matched any
other, less dangerous handlers.
At any rate, I think this behavior is questionable. At a minimum it should be documented in %autocall? so users understand the risks of having it enabled.