classification
Title: Add a PyCF_DISPLAY_EXPRESSION_RESULTS flag
Type: enhancement Stage: needs patch
Components: Interpreter Core Versions: Python 3.4
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: BTaskaya, aliles, benjamin.peterson, kristjan.jonsson, nanjekyejoannah, ncoghlan
Priority: low Keywords:

Created on 2012-12-09 06:34 by ncoghlan, last changed 2019-12-01 12:13 by BTaskaya.

Messages (3)
msg177199 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2012-12-09 06:34
code.InteractiveConsole.push attempts to support multi-line input when using an input method that doesn't reliably split on newlines.

This support fails as soon as the multi-line input contains multiple statements (including when the last statement is incomplete).

However, switching to 'exec' instead of 'single' causes other problems - specifically, it turns off the expression printing.

While expression printing could be implied by the PyCF_DONT_IMPLY_DEDENT flag in addition to the "single" evaluation mode, it seems cleaner to break out the expression printing behaviour into its own flag and setting it appropriately in the code and/or codeop modules.
msg177223 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2012-12-09 15:29
I'm sort of surprised "single" doesn't handle that already. Should it not?
msg177245 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2012-12-09 22:46
Not when the string is provided as one big block of text. I haven't checked
yet if including a blank line after compound statements makes a difference,
though.
History
Date User Action Args
2019-12-01 12:13:25BTaskayasetnosy: + BTaskaya
2019-09-09 02:52:27nanjekyejoannahsetnosy: + nanjekyejoannah
2012-12-09 22:46:07ncoghlansetmessages: + msg177245
2012-12-09 15:29:10benjamin.petersonsetmessages: + msg177223
2012-12-09 06:37:41ncoghlanlinkissue7741 dependencies
2012-12-09 06:36:46ncoghlansettype: enhancement
stage: needs patch
2012-12-09 06:36:30ncoghlansettitle: Add a PyCF_PRINT_EXPRESSION_RESULTS flag -> Add a PyCF_DISPLAY_EXPRESSION_RESULTS flag
2012-12-09 06:34:59ncoghlansetnosy: + benjamin.peterson
2012-12-09 06:34:28ncoghlancreate