Skip to content

gh-111201: auto-indentation in _pyrepl - #119348

Merged
ambv merged 2 commits into
python:mainfrom
wiggin15:pyrepl-auto-indent
May 22, 2024
Merged

gh-111201: auto-indentation in _pyrepl#119348
ambv merged 2 commits into
python:mainfrom
wiggin15:pyrepl-auto-indent

Conversation

@wiggin15

@wiggin15wiggin15 commented May 21, 2024

Copy link
Copy Markdown
Contributor

Auto-indent blocks in new _pyrepl when the user presses after a line that should start a new block. By default, indent by 4 spaces, but keep the user indentation if the user changes it.

Ideas for future improvement (not included in this PR):

  • Add configuration to specify default number of spaces
  • Better parsing of latest line to support auto indentation after lines like this: if foo: # bar (currently it will not auto-indent after this line)

@bedevere-appbedevere-appBot mentioned this pull request May 21, 2024
7 tasks
@ambvambv added skip news topic-repl Related to the interactive shell labels May 21, 2024
@ambv
ambvforce-pushed the pyrepl-auto-indent branch from 5090e05 to ac4a8a5CompareMay 22, 2024 02:51
@wiggin15

Copy link
Copy Markdown
ContributorAuthor

Hi @ambv , I see the commit authorship changed for the first commit 😬

@ambv
ambv merged commit cd516cd into python:mainMay 22, 2024
@ambv

ambv commented May 22, 2024

Copy link
Copy Markdown
Contributor

We squash all commits so this isn't important. As you can see in cd516cd the merged commit is attributed to you.

@ambv

ambv commented May 22, 2024

Copy link
Copy Markdown
Contributor

Thanks for your contribution, Arnon!

@lysnikolaoulysnikolaou added the needs backport to 3.13 bugs and security fixes label May 22, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @wiggin15 for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @wiggin15 and @ambv, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker cd516cd1f5e94dba887353f421513fd172efadf3 3.13

lysnikolaou pushed a commit to lysnikolaou/cpython that referenced this pull request May 22, 2024
(cherry picked from commit cd516cd)
Co-authored-by: Arnon Yaari <wiggin15@yahoo.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
lysnikolaou pushed a commit to lysnikolaou/cpython that referenced this pull request May 22, 2024
(cherry picked from commit cd516cd)
Co-authored-by: Arnon Yaari <wiggin15@yahoo.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
@bedevere-app

Copy link
Copy Markdown

GH-119427 is a backport of this pull request to the 3.13 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.13 bugs and security fixes label May 22, 2024
ambv added a commit that referenced this pull request May 22, 2024
(cherry picked from commit cd516cd)
Co-authored-by: Arnon Yaari <wiggin15@yahoo.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
@wiggin15
wiggin15 deleted the pyrepl-auto-indent branch May 27, 2024 14:06
@JelleZijlstraJelleZijlstra mentioned this pull request May 28, 2024
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip newstopic-replRelated to the interactive shell

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@wiggin15@ambv@lysnikolaou