[IPython-dev] TryNext exceptions usage

Thomas Kluyver takowl at gmail.com
Wed May 16 15:14:16 EDT 2012


Hi all,

Following on from discussion on pull request #1741, we're proposing to
remove the ability for a TryNext exception to carry args and kwargs.
This is part of the CommandChainDispatcher system, whereby a series of
functions can be called until one *doesn't* raise TryNext. In
principle, a function can raise TryNext with args/kwargs, which will
replace the original arguments when the next function in the chain is
called. In practice, there's nothing in the IPython codebase that does
that, and it's hard to think of a use case. The principle of loose
coupling suggests that a function shouldn't know what's next in the
chain.

Does anyone object to us removing that functionality (i.e. when a
CommandChainDispatcher is called, each function would get the original
args/kwargs)? In particular, do we know of any extension code that
uses TryNext exceptions to change args/kwargs?

Thanks,
Thomas



More information about the IPython-dev mailing list