Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idle: conflict between loop execution and undo shortcut. #67804

Open
DavideOkami mannequin opened this issue Mar 9, 2015 · 4 comments
Open

Idle: conflict between loop execution and undo shortcut. #67804

DavideOkami mannequin opened this issue Mar 9, 2015 · 4 comments
Assignees
Labels
3.10 only security fixes topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@DavideOkami
Copy link
Mannequin

DavideOkami mannequin commented Mar 9, 2015

BPO 23616
Nosy @terryjreedy
Files
  • Schermata 2015-03-09 alle 06.53.21.png: Screenshot [2]
  • 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 = 'https://github.com/terryjreedy'
    closed_at = None
    created_at = <Date 2015-03-09.06:18:26.616>
    labels = ['expert-IDLE', 'type-bug', '3.10']
    title = 'Idle: conflict between loop execution and undo shortcut.'
    updated_at = <Date 2020-06-07.22:17:44.889>
    user = 'https://bugs.python.org/DavideOkami'

    bugs.python.org fields:

    activity = <Date 2020-06-07.22:17:44.889>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = False
    closed_date = None
    closer = None
    components = ['IDLE']
    creation = <Date 2015-03-09.06:18:26.616>
    creator = 'Davide Okami'
    dependencies = []
    files = ['38400']
    hgrepos = []
    issue_num = 23616
    keywords = []
    message_count = 4.0
    messages = ['237594', '237599', '237601', '237701']
    nosy_count = 2.0
    nosy_names = ['terry.reedy', 'Davide Okami']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'test needed'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue23616'
    versions = ['Python 3.10']

    @DavideOkami
    Copy link
    Mannequin Author

    DavideOkami mannequin commented Mar 9, 2015

    Keeping pressed the undo shortcut during a cycle until returning to the cycle declaration, IDLE will react deleting the declaration [1] or overlaying it on the result/s [2] ([2] intermittently and un-effectively on cycle execution).

    @DavideOkami DavideOkami mannequin added topic-IDLE type-bug An unexpected behavior, bug, or error labels Mar 9, 2015
    @DavideOkami DavideOkami mannequin changed the title Python IDLE (2.-3.) Conflict between generic cycle and undo shortcut. Mar 9, 2015
    @terryjreedy
    Copy link
    Member

    (Duplicate message unlinked). I do not know what you mean by a 'cycle', 'generic cycle', or 'cycle declaration'. Python's only declarations are global and nonlocal statements. The image does not help me except to specify OSX (latest version) an 3.4.2. Please describe what you actually did in enough detail that I could do the same. What is the undo shortcut on OSX, or specifically your machine?

    @terryjreedy terryjreedy changed the title Conflict between generic cycle and undo shortcut. Idle: conflict between generic cycle and undo shortcut. Mar 9, 2015
    @DavideOkami
    Copy link
    Mannequin Author

    DavideOkami mannequin commented Mar 9, 2015

    Sorry for my bad technical acknowledgment, i will try to be more understandable.
    Declaring a while loop statement, and launching the loop pressing enter, it is possible to delete loop results and return to the while declaration statement deleting it [1] or it's possibile to make it disappear from the line in which it was declared [2] [[2] making it appear on the loop result (overlaying it)] without breaking the loop execution [1][2]. Both are possible keeping pressed the shortcut command+z (⌘+z) after that loop runs (keeping it pressed until the loop statement is reached and deleted [1], or keeping it pressed for a little less time than before, to manifest the second behavior). The bug afflicts Python IDLE for OS X (i tried with a clean installation of Python 3.4.3 and i tried it also on Windows without results) in versions 2.7.8, 3.4.x (as i tried).

    @DavideOkami DavideOkami mannequin changed the title Idle: conflict between generic cycle and undo shortcut. Idle: conflict between loop execution and undo shortcut. Mar 9, 2015
    @terryjreedy
    Copy link
    Member

    terryjreedy commented Mar 9, 2015

    I believe you are reporting the following behavior, which I believe I have seen before but which seems not to be the subject of a tracker issue. If I run

    import time
    for i in range(20):
    	print(i)
    	time.sleep(.5)

    either in Shell at >>> or from the editor, and hold Undo (^Z for me on Windows), output is deleted back to the previous >>>. When the statements are enter in Shell, that means erasing the visible 'for' statement. A bit to my surprise, <> (alt-P for me) still reloads the 'for' statement.

    While this behavior is entirely avoidable by users (don't hit Undo after Enter), I agree that it is not desirable. At minimum, it should be possible to clear the undo buffer when code is submitted for execution, just as it is when >>> is printed. That should prevent removal of the entered statement.

    I believe Undo is left active during execution so it will be active during user entry in response to input('prompt'). Also, one can start entering input before 'prompt' is printed. So avoiding adding output to Undo would be trickier.

    --
    Please don't fiddle with the Versions: settings. This is not a security issue, any change will be applied to 3.5.

    @terryjreedy terryjreedy added the 3.7 (EOL) end of life label Jun 23, 2017
    @terryjreedy terryjreedy self-assigned this Jun 23, 2017
    @terryjreedy terryjreedy added 3.10 only security fixes and removed 3.7 (EOL) end of life labels Jun 7, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes topic-IDLE type-bug An unexpected behavior, bug, or error
    Projects
    Status: No status
    Development

    No branches or pull requests

    1 participant