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-81087: Add str.dedent and cache it at compile time by remilapeyre · Pull Request #13445 · python/cpython

Conversation

@remilapeyre

@remilapeyre remilapeyre commented May 20, 2019 •
edited by terryjreedy
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor
  • Issue: Compile time textwrap.dedent() equivalent for str or bytes literals #81087

Sorry, something went wrong.

Uh oh!

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

All reactions
Rémi Lapeyre added 3 commits May 20, 2019 16:52
Rémi Lapeyre
Implement str.dedent
49d90e5
Rémi Lapeyre
Peephole str.dedent
64fda8f
Rémi Lapeyre
Add PendingDeprecationWarning
2f22dd1
@remilapeyre
remilapeyre requested review from a team and rhettinger as code owners May 20, 2019 14:53
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label May 20, 2019
@bedevere-bot bedevere-bot added the awaiting review label May 20, 2019
Rémi Lapeyre added 2 commits May 20, 2019 18:18
Rémi Lapeyre
Move str.dedent optimization in the AST
3c1449c
Rémi Lapeyre
Add missing DECREF
69eab29
Carreau
Carreau reviewed May 21, 2019
View reviewed changes
Comment thread Lib/textwrap.py Resolved

Uh oh!

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

Carreau
Carreau reviewed May 21, 2019
View reviewed changes
Comment thread Python/ast_opt.c Resolved

Uh oh!

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

gpshead
gpshead requested changes May 21, 2019
View reviewed changes

@gpshead gpshead left a comment

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.

missing: A documentation update documenting the new str.dedent method.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/test/test_configparser.py Resolved

Uh oh!

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

Comment thread Lib/test/test_unicode.py Resolved

Uh oh!

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

Comment thread Objects/unicodeobject.c Resolved

Uh oh!

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

@bedevere-bot bedevere-bot added awaiting changes and removed awaiting review labels May 21, 2019
@bedevere-bot

bedevere-bot commented May 21, 2019

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

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

tirkarthi
tirkarthi reviewed May 21, 2019
View reviewed changes
Comment thread Lib/textwrap.py Resolved

Uh oh!

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

Rémi Lapeyre added 3 commits May 21, 2019 12:02
Rémi Lapeyre
Fix review comments
514571b
Rémi Lapeyre
Document str.dedent()
c984b7a
Rémi Lapeyre
Add blurb
886cdf9
@csabella

csabella commented May 21, 2019

Copy link
Copy Markdown
Contributor

@remilapeyre, if your changes are ready to be reviewed again, please add a PR-level comment as requested by @bedevere-bot. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

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

@remilapeyre

remilapeyre commented May 21, 2019

Copy link
Copy Markdown
Contributor Author

@csabella, sorry, I have made the requested changes; please review again

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot added awaiting change review and removed awaiting changes labels May 21, 2019
@bedevere-bot

bedevere-bot commented May 21, 2019

Copy link
Copy Markdown

Thanks for making the requested changes!

@gpshead: please review the changes made to this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

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

@csabella
csabella requested a review from gpshead June 1, 2019 19:09
@csabella

csabella commented Jan 18, 2020

Copy link
Copy Markdown
Contributor

@remilapeyre, please resolve the merge conflicts. Thank you!

All reactions

Sorry, something went wrong.

Uh oh!

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

Rémi Lapeyre added 2 commits January 20, 2020 15:05
Rémi Lapeyre
Merge remote-tracking branch 'origin/master' into str.dedent
61bec5a
Rémi Lapeyre
Merge remote-tracking branch 'origin/master' into str.dedent
c5bbe75
@remilapeyre
remilapeyre requested a review from vsajip as a code owner January 20, 2020 14:26
@remilapeyre

remilapeyre commented Jan 20, 2020

Copy link
Copy Markdown
Contributor Author

Hi @csabella, it should be good now. There is a lot of PendingDeprecationWarnings in the tests. I'm not sure what I should do, should I fix all calls or let them as is for now?

All reactions

Sorry, something went wrong.

Uh oh!

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

@remilapeyre
remilapeyre requested a review from warsaw as a code owner April 26, 2020 22:46
Rémi Lapeyre
Remove useless textwrap imports
7d0d82d
@remilapeyre

remilapeyre commented Apr 26, 2020

Copy link
Copy Markdown
Contributor Author

Hi @csabella and @gpshead, I fix the conflicts and updated the Pull Request. Can you review again?

All reactions

Sorry, something went wrong.

Uh oh!

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

@terryjreedy
terryjreedy removed request for 1st1, asvetlov, brettcannon, encukou, ericsnowcurrently, ncoghlan, pablogsal, terryjreedy and warsaw April 27, 2020 01:02
@gpshead

gpshead commented Nov 21, 2020

Copy link
Copy Markdown
Member

One thing I think would help this PR is not updating so many Lib/test/test_*.py files to replace their existing textwrap.dedent usage. It'd avoid the need for nearly so many conflict resolutions.

Changing those to use the new .dedent() method can be done in followups.

All reactions

Sorry, something went wrong.

Uh oh!

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

@gpshead gpshead self-assigned this Nov 21, 2020
@ammaraskar

ammaraskar commented Jul 27, 2021

Copy link
Copy Markdown
Member

@remilapeyre Would you like to untangle the code changes here from updating existing usages of textwrap.dedent like Gregory suggested or do you mind if someone else bases off this work with a Co-authored-by tag with you?

All reactions

Sorry, something went wrong.

Uh oh!

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

@remilapeyre

remilapeyre commented Aug 27, 2021

Copy link
Copy Markdown
Contributor Author

Hi @ammaraskar I don't mind either as I was seriously lacking time to take care of this the past few months. I'm trying to find half a day a week to work on CPython again so I should come back to this PR in a few days.

All reactions

Sorry, something went wrong.

Uh oh!

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

@rhettinger
rhettinger removed their request for review May 5, 2022 04:18
@ezio-melotti ezio-melotti removed the CLA signed label Jul 13, 2022
@gpshead gpshead mentioned this pull request Jan 9, 2023
Compile time textwrap.dedent() equivalent for str or bytes literals #81087
Open
hauntsaninja
hauntsaninja requested changes Feb 9, 2023
View reviewed changes

@hauntsaninja hauntsaninja left a comment

Copy link
Copy Markdown
Contributor

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.

Requesting changes as per above; we should separate the implementation of the feature from its use elsewhere in the codebase

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-bot bedevere-bot added awaiting changes and removed awaiting change review labels Feb 9, 2023
@bedevere-bot

bedevere-bot commented Feb 9, 2023

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

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

@terryjreedy terryjreedy changed the title bpo-36906: Add str.dedent and cache it at compile time gh-81087: Add str.dedent and cache it at compile time Feb 11, 2023
terryjreedy
terryjreedy requested changes Feb 11, 2023
View reviewed changes
Comment thread Lib/idlelib/idle_test/htest.py
'file': 'sidebar',
'kwds': {},
'msg': textwrap.dedent("""\
'msg': """\

@terryjreedy terryjreedy Feb 11, 2023

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 don't like having '.dedent moved from here to the end 16 lines down.

In any case, I want both idlelib changes removed from this PR to avoid gratuitous differences between versions.

Sorry, something went wrong.

Uh oh!

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

All reactions
@gpshead gpshead removed their assignment May 20, 2023
@gpshead gpshead added the stale Stale PR or inactive for long period of time. label May 20, 2023
@gpshead
gpshead requested a review from methane July 23, 2023 20:04
@StanFromIreland

StanFromIreland commented Oct 29, 2025

Copy link
Copy Markdown
Member

Closing this, it requires a PEP and is now quite a bit out of date.

All reactions

Sorry, something went wrong.

Uh oh!

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

@StanFromIreland StanFromIreland closed this Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tirkarthi tirkarthi tirkarthi left review comments
@hauntsaninja hauntsaninja hauntsaninja requested changes
@terryjreedy terryjreedy terryjreedy requested changes
@vsajip vsajip Awaiting requested review from vsajip vsajip is a code owner
@gpshead gpshead Awaiting requested review from gpshead gpshead is a code owner
@methane methane Awaiting requested review from methane
+1 more reviewer
@Carreau Carreau Carreau left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

No one assigned

Labels

awaiting changes stale Stale PR or inactive for long period of time.

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.

12 participants

@remilapeyre @bedevere-bot @csabella @gpshead @ammaraskar @StanFromIreland @Carreau @tirkarthi @hauntsaninja @terryjreedy @the-knights-who-say-ni @ezio-melotti
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.