You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IDLE regression: toggle tabs and change indent width functions #82817
Both the menu items and the short cuts for these two functions on the Format menu give these call errors. They are only visible if IDLE is started from a console.
They work in 3.6; the regression is due to bpo-36390. These 2 functions were moved separately from the others in the 3rd PR, PR 14827, changeset 1b38922. I found the mistake and believe I have one possible version of a working fix on a new branch.
The diff contains this comment:
# With mixed indents not allowed, these are semi-useless and not unittested.
I was thinking that they should be removed, but regardless, they should have been manually tested. However, in one test with 3.6, a mixed indent -- tab + 4 spaces following a 4 space tab -- did work, so I am not sure of the rule. I will try to add a unittest along with the fix.
changed the title [-]"Alt + T" and "Alt + U" Broken in IDLE on Windows[/-][+]IDLE regression: toggle tabs and change indent width functions[/+]on Oct 30, 2019
Zero commented on Oct 30, 2019
Zeromannequin
MannequinAuthor
More actions
When I start IDLE and the shell window appears, my first task is to press "Alt + T" to change from using tabs to spaces and then "Alt + U" to change from using 8 spaces to 4. This allows code pasted from the shell into an editor window or other IDE to not require reformatting since those settings seem to be common for Python code. If the defaults for these settings were to be exposed in IDLE's settings under the General tab (maybe near the new "Show line numbers in new windows" checkbox), would it be best to make that request here or to open a new bug with an enhancement suggestion?
Interesting. The result of making these changes is legal code looking like
>>> if a:
if b:
c = 3
This has been proposed as the way Shell should work, but rejected as likely too confusing to beginners as the indented code does not look indented compared to the line above. The use of tabs for indents in Shell has long been considered a wart that is a 'least bad solution'.
Please hold your proposals. I intend to solve the issue by moving the prompt to a shell sidebar and use the same indent in shell as in editors. bpo-37903 has a PR under review.
Activity
Zero commentedon Oct 29, 2019
In the latest Python 3.8.0 installation when running IDLE on Windows, pressing "Alt + T" generates the following error:
Similarly, pressing "Alt + U" will generate a very similar error:
terryjreedy commentedon Oct 30, 2019
Both the menu items and the short cuts for these two functions on the Format menu give these call errors. They are only visible if IDLE is started from a console.
They work in 3.6; the regression is due to bpo-36390. These 2 functions were moved separately from the others in the 3rd PR, PR 14827, changeset 1b38922. I found the mistake and believe I have one possible version of a working fix on a new branch.
The diff contains this comment:
# With mixed indents not allowed, these are semi-useless and not unittested.
I was thinking that they should be removed, but regardless, they should have been manually tested. However, in one test with 3.6, a mixed indent -- tab + 4 spaces following a 4 space tab -- did work, so I am not sure of the rule. I will try to add a unittest along with the fix.
[-]"Alt + T" and "Alt + U" Broken in IDLE on Windows[/-][+]IDLE regression: toggle tabs and change indent width functions[/+]Zero commentedon Oct 30, 2019
When I start IDLE and the shell window appears, my first task is to press "Alt + T" to change from using tabs to spaces and then "Alt + U" to change from using 8 spaces to 4. This allows code pasted from the shell into an editor window or other IDE to not require reformatting since those settings seem to be common for Python code. If the defaults for these settings were to be exposed in IDLE's settings under the General tab (maybe near the new "Show line numbers in new windows" checkbox), would it be best to make that request here or to open a new bug with an enhancement suggestion?
terryjreedy commentedon Oct 31, 2019
Interesting. The result of making these changes is legal code looking like >>> if a: if b: c = 3 This has been proposed as the way Shell should work, but rejected as likely too confusing to beginners as the indented code does not look indented compared to the line above. The use of tabs for indents in Shell has long been considered a wart that is a 'least bad solution'.Please hold your proposals. I intend to solve the issue by moving the prompt to a shell sidebar and use the same indent in shell as in editors. bpo-37903 has a PR under review.
terryjreedy commentedon Oct 31, 2019
The old, long discussion of Shell indents is bpo-7676 and a preceding issue reference therein. My replacement is bpo-37892.
The PR patch is simple enough to apply by to existing 3.7.5 and 3.8.0 installs.
terryjreedy commentedon Nov 20, 2019
New changeset b846247 by Terry Jan Reedy in branch 'master':
bpo-38636: Fix IDLE tab toggle and file indent width (GH-17008)
b846247
miss-islington commentedon Nov 20, 2019
New changeset 755caaa by Miss Islington (bot) in branch '3.7':
bpo-38636: Fix IDLE tab toggle and file indent width (GH-17008)
755caaa
miss-islington commentedon Nov 20, 2019
New changeset 1322439 by Miss Islington (bot) in branch '3.8':
bpo-38636: Fix IDLE tab toggle and file indent width (GH-17008)
1322439