Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make default value of interactivity passed to run_ast_nodes configurable

  • Loading branch information...
commit e36957765aad5f9267eecc21eaad8f5f632774b5 1 parent 89c2337
@mwhansen mwhansen authored
View
7 IPython/core/interactiveshell.py
@@ -368,6 +368,11 @@ def _prompt_trait_changed(self, name, old, new):
'"\C-u": unix-line-discard',
], allow_none=False, config=True)
+ ast_node_interactivity = Unicode('last_expr', config=True, help="""
+ 'all', 'last', 'last_expr' or 'none'," specifying which nodes should be
+ run interactively (displaying output from expressions).
+ """)
+
# TODO: this part of prompt management should be moved to the frontends.
# Use custom TraitTypes that convert '0'->'' and '\\n'->'\n'
separate_in = SeparateUnicode('\n', config=True)
@@ -2576,7 +2581,7 @@ def run_cell(self, raw_cell, store_history=False, silent=False):
self.execution_count += 1
return None
- interactivity = "none" if silent else "last_expr"
+ interactivity = "none" if silent else self.ast_node_interactivity
self.run_ast_nodes(code_ast.body, cell_name,
interactivity=interactivity)
View
4 docs/source/whatsnew/development.txt
@@ -21,3 +21,7 @@ Other new features
migrating to this variable is not worth the aesthetic improvement. Please use
the historical :envvar:`IPYTHONDIR` environment variable instead.
+* The default value of *interactivity* passed from
+ :meth:`~IPython.core.interactiveshell.InteractiveShell.run_cell` to
+ :meth:`~IPython.core.interactiveshell.InteractiveShell.run_ast_nodes`
+ is now configurable.
Please sign in to comment.
Something went wrong with that request. Please try again.