[IPython-dev] Package-specific extensions: an idea
fperez.net at gmail.com
Mon Apr 23 02:19:04 EDT 2012
On Fri, Jun 17, 2011 at 11:26 AM, Robert Kern <robert.kern at gmail.com> wrote:
> Except that you don't want to register a separate function for each extension.
> You want to have a single function that deals with all of the delayed
> activations. And you want to implement this logic exactly once, not reimplement
> it in each extension that needs it.
> How about this: we implement the logic that goes through the list of
> ('module_name', 'extension_name') pairs in an
> InteractiveShell.check_deferred_extensions() method. We keep the configuration
> in c.Global.deferred_extensions as I had it. We make no modifications to the
> run_cell() method. Upon configuration, *if* deferred_extensions is not empty,
> then the InteractiveShell uses
we seem to have dropped the ball on this one due to lack of bandwidth
with the whirlwind of last year's work. I actually like the basic
idea you were proposing, as long as we use the post_execute hook to do
the registration rather than adding a hard-coded check on sys.modules
to every single execution.
If wrapped into a single flag that can be set by users who want this
capability, as you propose, I think it could be very useful.
If you're still interested, feel free to put up a PR with an
implementation and we can go ahead with review.
More information about the IPython-dev