##// END OF EJS Templates
Make default value of interactivity passed to run_ast_nodes configurable
Mike Hansen -
Show More
@@ -368,6 +368,11 b' class InteractiveShell(SingletonConfigurable):'
368 368 '"\C-u": unix-line-discard',
369 369 ], allow_none=False, config=True)
370 370
371 ast_node_interactivity = Unicode('last_expr', config=True, help="""
372 'all', 'last', 'last_expr' or 'none'," specifying which nodes should be
373 run interactively (displaying output from expressions).
374 """)
375
371 376 # TODO: this part of prompt management should be moved to the frontends.
372 377 # Use custom TraitTypes that convert '0'->'' and '\\n'->'\n'
373 378 separate_in = SeparateUnicode('\n', config=True)
@@ -2576,7 +2581,7 b' class InteractiveShell(SingletonConfigurable):'
2576 2581 self.execution_count += 1
2577 2582 return None
2578 2583
2579 interactivity = "none" if silent else "last_expr"
2584 interactivity = "none" if silent else self.ast_node_interactivity
2580 2585 self.run_ast_nodes(code_ast.body, cell_name,
2581 2586 interactivity=interactivity)
2582 2587
@@ -21,3 +21,7 b' Other new features'
21 21 migrating to this variable is not worth the aesthetic improvement. Please use
22 22 the historical :envvar:`IPYTHONDIR` environment variable instead.
23 23
24 * The default value of *interactivity* passed from
25 :meth:`~IPython.core.interactiveshell.InteractiveShell.run_cell` to
26 :meth:`~IPython.core.interactiveshell.InteractiveShell.run_ast_nodes`
27 is now configurable.
General Comments 0
You need to be logged in to leave comments. Login now