Skip to content

Add a PyCF_DISPLAY_EXPRESSION_RESULTS flag #60853

Open

Description

@ncoghlan
BPO 16649
Nosy @ncoghlan, @kristjanvalur, @benjaminp, @nanjekyejoannah, @isidentical

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2012-12-09.06:34:28.759>
labels = ['interpreter-core', 'type-feature']
title = 'Add a PyCF_DISPLAY_EXPRESSION_RESULTS flag'
updated_at = <Date 2019-12-01.12:13:25.596>
user = 'https://github.com/ncoghlan'

bugs.python.org fields:

activity = <Date 2019-12-01.12:13:25.596>
actor = 'BTaskaya'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2012-12-09.06:34:28.759>
creator = 'ncoghlan'
dependencies = []
files = []
hgrepos = []
issue_num = 16649
keywords = []
message_count = 3.0
messages = ['177199', '177223', '177245']
nosy_count = 6.0
nosy_names = ['ncoghlan', 'kristjan.jonsson', 'benjamin.peterson', 'aliles', 'nanjekyejoannah', 'BTaskaya']
pr_nums = []
priority = 'low'
resolution = None
stage = 'needs patch'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue16649'
versions = ['Python 3.4']

Activity

  1. ncoghlan commented on Dec 9, 2012

    @ncoghlan
    ContributorAuthor

    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.

  2. added
    interpreter-core
    on Dec 9, 2012
  3. changed the title [-]Add a PyCF_PRINT_EXPRESSION_RESULTS flag[/-] [+]Add a PyCF_DISPLAY_EXPRESSION_RESULTS flag[/+] on Dec 9, 2012
  4. added
    type-feature
    on Dec 9, 2012
  5. benjaminp commented on Dec 9, 2012

    @benjaminp
    Contributor

    I'm sort of surprised "single" doesn't handle that already. Should it not?

  6. ncoghlan commented on Dec 9, 2012

    @ncoghlan
    ContributorAuthor

    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.

  7. transferred this issue fromon Apr 10, 2022
  8. devdanzin commented on Sep 18, 2025

    @devdanzin
    Member

    Is this one still relevant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-coretype-feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions