ipython/ipython — pull request #1140 by takluyver (2011-12-10 22:32:23+00:00)
Title: Namespaces for embedding

This should fix the embedding problem in #1136.

One additional complexity: if you specify only one of `user_ns` or `user_module` when instantiating the embedded shell, they are hooked up so that you have a single namespace (i.e. `ip.user_ns is ip.user_global_ns`). So, the logic at activation time to auto-detect the module and local namespace will only kick in if neither were specified at instantiation.

You should still be able to pass `local_ns` or `module` at activation to override them separately.