GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-125377: Improve tab indentation for pdb multi-line input by gaogaotiantian · Pull Request #130471 · python/cpython

Conversation

@gaogaotiantian

@gaogaotiantian gaogaotiantian commented Feb 22, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

We supported multi-line input in pdb in 3.13, but the tab indentation does not work in its best shape. It inserts a \t character, which means the first <tab> will introduce a 2-space (at least looks like it) indentation, and the next ones will introduce a 8-space one.

This PR made it a bit smarter. Now a <tab> at the beginning of the line (before any non-space text) will auto-fill a 4-space indentation. For example, \t and \t will both create a 4-space indentation.

This is not the smartest feature, it's not as good as pyrepl where the indentation is inserted when a new line is created. However, I think it's much better than what we have now.

The ultimate goal is to use pyrepl for pdb, so I don't think duplication too much code to make pdb work slightly better now is that rewarding.

  • Issue: Use 4 spaces for indentation in PDB #125377

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gaogaotiantian
Improve tab indentation for pdb multi-line input
36723c7
@bedevere-app bedevere-app Bot added the awaiting core review label Feb 22, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Feb 22, 2025
Use 4 spaces for indentation in PDB #125377
Closed
@blurb-it
📜🤖 Added by blurb_it.
cfda7ba
@gaogaotiantian
gaogaotiantian requested a review from iritkatriel February 22, 2025 19:44
@gaogaotiantian
Fix lint issue
9293b21
tomasr8
tomasr8 reviewed Feb 22, 2025
View reviewed changes
Comment thread Lib/test/test_pdb.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@gaogaotiantian
Use a single multi-line string input
41e37ec
tomasr8
tomasr8 approved these changes Feb 23, 2025
View reviewed changes
iritkatriel
iritkatriel reviewed Mar 3, 2025
View reviewed changes
Comment thread Misc/NEWS.d/next/Library/2025-02-22-19-44-00.gh-issue-125377.LFTK0H.rst
@@ -0,0 +1 @@
``<tab>`` at the beginning of the line in :mod:`pdb` multi-line input will fill in a 4-space indentation now, instead of inserting a ``\t`` character.

@iritkatriel iritkatriel Mar 3, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add this to what's new in 3.14.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@gaogaotiantian gaogaotiantian Mar 4, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gaogaotiantian added 2 commits March 4, 2025 11:43
@gaogaotiantian
Merge branch 'main' into multiline-completion
eaa8bd9
@gaogaotiantian
Add whatsnew entry
64965f3
iritkatriel
iritkatriel approved these changes Mar 4, 2025
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Mar 4, 2025
@gaogaotiantian
gaogaotiantian merged commit b6769e9 into python:main Mar 4, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label Mar 4, 2025
@gaogaotiantian
gaogaotiantian deleted the multiline-completion branch March 5, 2025 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@iritkatriel iritkatriel iritkatriel approved these changes
@tomasr8 tomasr8 tomasr8 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@gaogaotiantian @iritkatriel @tomasr8
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.