xdev._ipython_ext module

class xdev._ipython_ext.InteractiveShellEmbedEnhanced(**kwargs: Any)[source]

Bases: InteractiveShellEmbed

A workaround to issue https://github.com/ipython/ipython/issues/10695 In embedded ipython shell, new variables are created in locals() instead of globals() and functions do not make closures for the locals.

Examples:

If not embedded from a function, then nothing special needs to be done other than calling embed() defined below. These code will work:

a=3; (lambda: a)() import time; (lambda: time.time())()

If embedded from a function, in order to introduce new variables to global name space, we need to call ipy.to_global() first and then call ipy.to_local() to come back

ipy.to_global() a=3 # here we cannot access the local variables ipy.to_local() (lambda: a)()

It seems that a contextmanager to switch back automatically will not work:

with ipy.to_global_manager():

a=3 print((lambda: a)())

It may be because of that IPython compiles the whole cell and run it using exec(code, globals, locals). But globals and locals are calculated at the time this context manager is defined.

property user_global_ns
init_frame(frame)[source]
_to_global()[source]
_to_local()[source]
share_locals()[source]

share the locals to global manually

_all_trait_default_generators: dict[str, t.Any] = {'_post_execute': <bound method TraitType.default of <traitlets.traitlets.Dict object>>, 'alias_manager': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, 'ast_node_interactivity': <bound method TraitType.default of <traitlets.traitlets.Enum object>>, 'ast_transformers': <bound method TraitType.default of <traitlets.traitlets.List object>>, 'auto_match': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'autoawait': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'autocall': <bound method TraitType.default of <traitlets.traitlets.Enum object>>, 'autoformatter': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'autoindent': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'automagic': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'autosuggestions_provider': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'banner1': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'banner2': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'builtin_trap': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, 'cache_size': <bound method TraitType.default of <traitlets.traitlets.Int object>>, 'color_info': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'colors': <bound method TraitType.default of <traitlets.traitlets.CaselessStrEnum object>>, 'compiler_class': <bound method TraitType.default of <traitlets.traitlets.Type object>>, 'config': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, 'confirm_exit': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'debug': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'debugger_history_file': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'disable_failing_post_execute': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'display_banner': <bound method TraitType.default of <traitlets.traitlets.CBool object>>, 'display_completions': <bound method TraitType.default of <traitlets.traitlets.Enum object>>, 'display_formatter': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, 'display_page': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'display_pub_class': <bound method TraitType.default of <traitlets.traitlets.Type object>>, 'display_trap': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, 'displayhook_class': <traitlets.traitlets.DefaultHandler object>, 'dummy_mode': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'editing_mode': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'editor': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'emacs_bindings_in_vi_insert_mode': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'embedded': <bound method TraitType.default of <traitlets.traitlets.CBool object>>, 'enable_history_search': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'enable_html_pager': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'execution_count': <bound method TraitType.default of <traitlets.traitlets.Int object>>, 'exit_msg': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'exit_now': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'exiter': <traitlets.traitlets.DefaultHandler object>, 'extension_manager': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, 'extra_open_editor_shortcuts': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'filename': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'handle_return': <bound method TraitType.default of <traitlets.traitlets.Any object>>, 'highlight_matching_brackets': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'highlighting_style': <bound method Union.default of <traitlets.traitlets.Union object>>, 'highlighting_style_overrides': <bound method TraitType.default of <traitlets.traitlets.Dict object>>, 'history_length': <bound method TraitType.default of <traitlets.traitlets.Int object>>, 'history_load_length': <bound method TraitType.default of <traitlets.traitlets.Int object>>, 'history_manager': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, 'input_transformer_manager': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, 'input_transformers_post': <bound method TraitType.default of <traitlets.traitlets.List object>>, 'inspector_class': <bound method TraitType.default of <traitlets.traitlets.Type object>>, 'ipython_dir': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'last_execution_result': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, 'last_execution_succeeded': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'log': <traitlets.traitlets.DefaultHandler object>, 'logappend': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'logfile': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'logstart': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'loop_runner': <traitlets.traitlets.DefaultHandler object>, 'magics_manager': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, 'mime_renderers': <bound method TraitType.default of <traitlets.traitlets.Dict object>>, 'modal_cursor': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'mouse_support': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'object_info_string_level': <bound method TraitType.default of <traitlets.traitlets.Enum object>>, 'parent': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, 'payload_manager': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, 'pdb': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'prefilter_manager': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, 'profile_dir': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, 'prompt_includes_vi_mode': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'prompt_line_number_format': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'prompts': <traitlets.traitlets.DefaultHandler object>, 'prompts_class': <bound method TraitType.default of <traitlets.traitlets.Type object>>, 'quiet': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'separate_in': <bound method TraitType.default of <IPython.core.interactiveshell.SeparateUnicode object>>, 'separate_out': <bound method TraitType.default of <IPython.core.interactiveshell.SeparateUnicode object>>, 'separate_out2': <bound method TraitType.default of <IPython.core.interactiveshell.SeparateUnicode object>>, 'shortcuts': <bound method TraitType.default of <traitlets.traitlets.List object>>, 'should_raise': <bound method TraitType.default of <traitlets.traitlets.CBool object>>, 'show_rewritten_input': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'simple_prompt': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'space_for_menu': <bound method TraitType.default of <traitlets.traitlets.Int object>>, 'sphinxify_docstring': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'term_title': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'term_title_format': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'timeoutlen': <bound method TraitType.default of <traitlets.traitlets.Float object>>, 'true_color': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'ttimeoutlen': <bound method TraitType.default of <traitlets.traitlets.Float object>>, 'warn_venv': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'wildcards_case_sensitive': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'xmode': <bound method TraitType.default of <traitlets.traitlets.CaselessStrEnum object>>}
_descriptors = [<traitlets.traitlets.ObserveHandler object>, <traitlets.traitlets.ObserveHandler object>, <traitlets.traitlets.ObserveHandler object>, <traitlets.traitlets.DefaultHandler object>, <traitlets.traitlets.DefaultHandler object>, <traitlets.traitlets.ObserveHandler object>, <traitlets.traitlets.ObserveHandler object>, <traitlets.traitlets.DefaultHandler object>, <traitlets.traitlets.ObserveHandler object>, <traitlets.traitlets.ValidateHandler object>, <traitlets.traitlets.ObserveHandler object>, <traitlets.traitlets.DefaultHandler object>, <traitlets.traitlets.Dict object>, <traitlets.traitlets.DefaultHandler object>, <traitlets.traitlets.ObserveHandler object>, <traitlets.traitlets.ObserveHandler object>, <traitlets.traitlets.ValidateHandler object>, <traitlets.traitlets.ValidateHandler object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Enum object>, <traitlets.traitlets.List object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Enum object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Int object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.CaselessStrEnum object>, <traitlets.traitlets.Type object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.CBool object>, <traitlets.traitlets.Enum object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Type object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Type object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.CBool object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Int object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Any object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Union object>, <traitlets.traitlets.Dict object>, <traitlets.traitlets.Int object>, <traitlets.traitlets.Int object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.ObserveHandler object>, <traitlets.traitlets.ObserveHandler object>, <traitlets.traitlets.ObserveHandler object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.List object>, <traitlets.traitlets.Type object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Any object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Any object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Dict object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Enum object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Type object>, <traitlets.traitlets.Bool object>, <IPython.core.interactiveshell.SeparateUnicode object>, <IPython.core.interactiveshell.SeparateUnicode object>, <IPython.core.interactiveshell.SeparateUnicode object>, <traitlets.traitlets.List object>, <traitlets.traitlets.CBool object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Int object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Float object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Float object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.CaselessStrEnum object>]
_instance_inits = [<bound method ObserveHandler.instance_init of <traitlets.traitlets.ObserveHandler object>>, <bound method ObserveHandler.instance_init of <traitlets.traitlets.ObserveHandler object>>, <bound method ObserveHandler.instance_init of <traitlets.traitlets.ObserveHandler object>>, <bound method BaseDescriptor.instance_init of <traitlets.traitlets.DefaultHandler object>>, <bound method BaseDescriptor.instance_init of <traitlets.traitlets.DefaultHandler object>>, <bound method ObserveHandler.instance_init of <traitlets.traitlets.ObserveHandler object>>, <bound method ObserveHandler.instance_init of <traitlets.traitlets.ObserveHandler object>>, <bound method BaseDescriptor.instance_init of <traitlets.traitlets.DefaultHandler object>>, <bound method ObserveHandler.instance_init of <traitlets.traitlets.ObserveHandler object>>, <bound method ValidateHandler.instance_init of <traitlets.traitlets.ValidateHandler object>>, <bound method ObserveHandler.instance_init of <traitlets.traitlets.ObserveHandler object>>, <bound method BaseDescriptor.instance_init of <traitlets.traitlets.DefaultHandler object>>, <bound method BaseDescriptor.instance_init of <traitlets.traitlets.DefaultHandler object>>, <bound method ObserveHandler.instance_init of <traitlets.traitlets.ObserveHandler object>>, <bound method ObserveHandler.instance_init of <traitlets.traitlets.ObserveHandler object>>, <bound method ValidateHandler.instance_init of <traitlets.traitlets.ValidateHandler object>>, <bound method ValidateHandler.instance_init of <traitlets.traitlets.ValidateHandler object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method Type.instance_init of <traitlets.traitlets.Type object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method Type.instance_init of <traitlets.traitlets.Type object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method Type.instance_init of <traitlets.traitlets.Type object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method Type.instance_init of <traitlets.traitlets.Type object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method ObserveHandler.instance_init of <traitlets.traitlets.ObserveHandler object>>, <bound method ObserveHandler.instance_init of <traitlets.traitlets.ObserveHandler object>>, <bound method ObserveHandler.instance_init of <traitlets.traitlets.ObserveHandler object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method Type.instance_init of <traitlets.traitlets.Type object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method Type.instance_init of <traitlets.traitlets.Type object>>]
_static_immutable_initial_values: dict[str, t.Any] = {'alias_manager': None, 'auto_match': False, 'autoawait': True, 'autoformatter': None, 'autoindent': True, 'automagic': True, 'autosuggestions_provider': 'NavigableAutoSuggestFromHistory', 'banner1': "Python 3.11.6 (main, Feb  1 2024, 16:47:41) [GCC 11.4.0]\nType 'copyright', 'credits' or 'license' for more information\nIPython 8.21.0 -- An enhanced Interactive Python. Type '?' for help.\n", 'banner2': '', 'builtin_trap': None, 'cache_size': 1000, 'color_info': True, 'confirm_exit': True, 'debug': False, 'debugger_history_file': '~/.pdbhistory', 'disable_failing_post_execute': False, 'display_banner': True, 'display_formatter': None, 'display_page': False, 'display_trap': None, 'dummy_mode': False, 'editing_mode': 'emacs', 'editor': 'vi', 'emacs_bindings_in_vi_insert_mode': True, 'embedded': True, 'enable_history_search': True, 'enable_html_pager': False, 'execution_count': 1, 'exit_msg': '', 'exit_now': False, 'extension_manager': None, 'extra_open_editor_shortcuts': False, 'filename': '<ipython console>', 'handle_return': None, 'highlight_matching_brackets': True, 'history_length': 10000, 'history_load_length': 1000, 'history_manager': None, 'ipython_dir': '', 'last_execution_result': None, 'last_execution_succeeded': True, 'logappend': '', 'logfile': '', 'logstart': False, 'magics_manager': None, 'modal_cursor': True, 'mouse_support': False, 'parent': None, 'payload_manager': None, 'pdb': False, 'prefilter_manager': None, 'profile_dir': None, 'prompt_includes_vi_mode': True, 'prompt_line_number_format': '', 'quiet': False, 'should_raise': False, 'show_rewritten_input': True, 'simple_prompt': True, 'space_for_menu': 6, 'sphinxify_docstring': False, 'term_title': False, 'term_title_format': 'IPython: {cwd}', 'true_color': False, 'warn_venv': True, 'wildcards_case_sensitive': True}
_trait_default_generators = {}
_traits: dict[str, t.Any] = {'_post_execute': <traitlets.traitlets.Dict object>, 'alias_manager': <traitlets.traitlets.Instance object>, 'ast_node_interactivity': <traitlets.traitlets.Enum object>, 'ast_transformers': <traitlets.traitlets.List object>, 'auto_match': <traitlets.traitlets.Bool object>, 'autoawait': <traitlets.traitlets.Bool object>, 'autocall': <traitlets.traitlets.Enum object>, 'autoformatter': <traitlets.traitlets.Unicode object>, 'autoindent': <traitlets.traitlets.Bool object>, 'automagic': <traitlets.traitlets.Bool object>, 'autosuggestions_provider': <traitlets.traitlets.Unicode object>, 'banner1': <traitlets.traitlets.Unicode object>, 'banner2': <traitlets.traitlets.Unicode object>, 'builtin_trap': <traitlets.traitlets.Instance object>, 'cache_size': <traitlets.traitlets.Int object>, 'color_info': <traitlets.traitlets.Bool object>, 'colors': <traitlets.traitlets.CaselessStrEnum object>, 'compiler_class': <traitlets.traitlets.Type object>, 'config': <traitlets.traitlets.Instance object>, 'confirm_exit': <traitlets.traitlets.Bool object>, 'debug': <traitlets.traitlets.Bool object>, 'debugger_history_file': <traitlets.traitlets.Unicode object>, 'disable_failing_post_execute': <traitlets.traitlets.Bool object>, 'display_banner': <traitlets.traitlets.CBool object>, 'display_completions': <traitlets.traitlets.Enum object>, 'display_formatter': <traitlets.traitlets.Instance object>, 'display_page': <traitlets.traitlets.Bool object>, 'display_pub_class': <traitlets.traitlets.Type object>, 'display_trap': <traitlets.traitlets.Instance object>, 'displayhook_class': <traitlets.traitlets.Type object>, 'dummy_mode': <traitlets.traitlets.Bool object>, 'editing_mode': <traitlets.traitlets.Unicode object>, 'editor': <traitlets.traitlets.Unicode object>, 'emacs_bindings_in_vi_insert_mode': <traitlets.traitlets.Bool object>, 'embedded': <traitlets.traitlets.CBool object>, 'enable_history_search': <traitlets.traitlets.Bool object>, 'enable_html_pager': <traitlets.traitlets.Bool object>, 'execution_count': <traitlets.traitlets.Int object>, 'exit_msg': <traitlets.traitlets.Unicode object>, 'exit_now': <traitlets.traitlets.Bool object>, 'exiter': <traitlets.traitlets.Instance object>, 'extension_manager': <traitlets.traitlets.Instance object>, 'extra_open_editor_shortcuts': <traitlets.traitlets.Bool object>, 'filename': <traitlets.traitlets.Unicode object>, 'handle_return': <traitlets.traitlets.Any object>, 'highlight_matching_brackets': <traitlets.traitlets.Bool object>, 'highlighting_style': <traitlets.traitlets.Union object>, 'highlighting_style_overrides': <traitlets.traitlets.Dict object>, 'history_length': <traitlets.traitlets.Int object>, 'history_load_length': <traitlets.traitlets.Int object>, 'history_manager': <traitlets.traitlets.Instance object>, 'input_transformer_manager': <traitlets.traitlets.Instance object>, 'input_transformers_post': <traitlets.traitlets.List object>, 'inspector_class': <traitlets.traitlets.Type object>, 'ipython_dir': <traitlets.traitlets.Unicode object>, 'last_execution_result': <traitlets.traitlets.Instance object>, 'last_execution_succeeded': <traitlets.traitlets.Bool object>, 'log': <traitlets.traitlets.Any object>, 'logappend': <traitlets.traitlets.Unicode object>, 'logfile': <traitlets.traitlets.Unicode object>, 'logstart': <traitlets.traitlets.Bool object>, 'loop_runner': <traitlets.traitlets.Any object>, 'magics_manager': <traitlets.traitlets.Instance object>, 'mime_renderers': <traitlets.traitlets.Dict object>, 'modal_cursor': <traitlets.traitlets.Bool object>, 'mouse_support': <traitlets.traitlets.Bool object>, 'object_info_string_level': <traitlets.traitlets.Enum object>, 'parent': <traitlets.traitlets.Instance object>, 'payload_manager': <traitlets.traitlets.Instance object>, 'pdb': <traitlets.traitlets.Bool object>, 'prefilter_manager': <traitlets.traitlets.Instance object>, 'profile_dir': <traitlets.traitlets.Instance object>, 'prompt_includes_vi_mode': <traitlets.traitlets.Bool object>, 'prompt_line_number_format': <traitlets.traitlets.Unicode object>, 'prompts': <traitlets.traitlets.Instance object>, 'prompts_class': <traitlets.traitlets.Type object>, 'quiet': <traitlets.traitlets.Bool object>, 'separate_in': <IPython.core.interactiveshell.SeparateUnicode object>, 'separate_out': <IPython.core.interactiveshell.SeparateUnicode object>, 'separate_out2': <IPython.core.interactiveshell.SeparateUnicode object>, 'shortcuts': <traitlets.traitlets.List object>, 'should_raise': <traitlets.traitlets.CBool object>, 'show_rewritten_input': <traitlets.traitlets.Bool object>, 'simple_prompt': <traitlets.traitlets.Bool object>, 'space_for_menu': <traitlets.traitlets.Int object>, 'sphinxify_docstring': <traitlets.traitlets.Bool object>, 'term_title': <traitlets.traitlets.Bool object>, 'term_title_format': <traitlets.traitlets.Unicode object>, 'timeoutlen': <traitlets.traitlets.Float object>, 'true_color': <traitlets.traitlets.Bool object>, 'ttimeoutlen': <traitlets.traitlets.Float object>, 'warn_venv': <traitlets.traitlets.Bool object>, 'wildcards_case_sensitive': <traitlets.traitlets.Bool object>, 'xmode': <traitlets.traitlets.CaselessStrEnum object>}
xdev._ipython_ext.embed2(local_ns=None, **kwargs)[source]

based on IPython.terminal.embed.embed()

References

https://github.com/ipython/ipython/issues/10695