This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients epaine, taleinat, terry.reedy
Date 2020-08-21.16:55:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1598028907.87.0.0896052094903.issue41608@roundup.psfhosted.org>
In-reply-to
Content
Your example is 4 spaces, 3 (non-space) chars, 2 spaces, 3 chars, 2 spaces.
With the cursor after the 2 internal spaces, backspace deletes 1 space, not 2.  However, with the first block expanded from 3 chars to 4, backspace deletes both spaces.

Without out looking at the code, the uniform rule, when deleting a space to the left with Backspace, seems to be "Delete up to Indent spaces, stopping at the first non-space char or at a slice position that is a multiple of Indent."  Tabs in the text are interpreted as as many spaces needed to get to a position that is a multiple of 8.  I tested this with longer space runs and with Indent set to 5.

Deleting a space with Delete always deletes one char.  So single space deletion is available anywhere.

I consider the current behavior as a defensible design decision for a PEP 8 oriented Python code editor.  Multiple space deletion is a plus when deleting large space blocks, a minus when lining up multiple continuation lines.  While I could imagine turning off multiple space delete for internal blocks, I would rather trailing blocks be deleted all at once.  All in all, I consider a change fairly low priority at the moment.

The prompt is 4 chars: '>>> '.  Anything after that is an indent and should be treated as such.  It is the first line of a mini 'file' with one statement.  Treating this line differently would be a bug.
History
Date User Action Args
2020-08-21 16:55:07terry.reedysetrecipients: + terry.reedy, taleinat, epaine
2020-08-21 16:55:07terry.reedysetmessageid: <1598028907.87.0.0896052094903.issue41608@roundup.psfhosted.org>
2020-08-21 16:55:07terry.reedylinkissue41608 messages
2020-08-21 16:55:07terry.reedycreate