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-130167: Add a What's New entry for changes to ``textwrap.{de,in}dent`` by AA-Turner · Pull Request #131924 · python/cpython

Conversation

@AA-Turner

@AA-Turner AA-Turner commented Mar 31, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

📚 Documentation preview 📚: https://cpython-previews--131924.org.readthedocs.build/

  • Issue: Improve speed of stdlib functions by replacing re uses #130167

Sorry, something went wrong.

Uh oh!

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

All reactions
@AA-Turner
Note the textwrap.dedent optimisation and behaviour change
41a7ea8
@AA-Turner AA-Turner added docs Documentation in the Doc dir skip issue skip news labels Mar 31, 2025
@AA-Turner
AA-Turner requested a review from picnixz March 31, 2025 01:19
@github-project-automation github-project-automation Bot added this to Docs PRs Mar 31, 2025
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Mar 31, 2025
@bedevere-app bedevere-app Bot added the awaiting core review label Mar 31, 2025
@AA-Turner AA-Turner mentioned this pull request Mar 31, 2025
gh-130167: Optimise textwrap.dedent() #131919
Merged
picnixz
picnixz reviewed Mar 31, 2025
View reviewed changes

@picnixz picnixz 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.

There is a note:

Note that tabs and spaces are both treated as whitespace, but they are not
equal: the lines ``"  hello"`` and ``"\thello"`` are considered to have no
common leading whitespace.

The new implementation still guarantees this right?

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Doc/whatsnew/3.14.rst Outdated
Comment on lines +1081 to +1082
characters other than space and tab.

@picnixz picnixz Mar 31, 2025 •
edited
Loading

Uh oh!

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

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.

Add something like (to be able to see the issue)

  characters other than space and tab.
  (Contributed by [...] in :gh:`...`.)

+ 2 blank lines to end the section.

Sorry, something went wrong.

Uh oh!

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

All reactions
@picnixz picnixz changed the title Add a What's New entry for the changes to textwrap.dedent gh-130167: Add a What's New entry for the changes to textwrap.dedent Mar 31, 2025
@picnixz picnixz removed the skip issue label Mar 31, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Mar 31, 2025
Improve speed of stdlib functions by replacing re uses #130167
Open
StanFromIreland
StanFromIreland reviewed Mar 31, 2025
View reviewed changes
Comment thread Doc/library/textwrap.rst Resolved

Uh oh!

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

picnixz
picnixz reviewed Mar 31, 2025
View reviewed changes
Comment thread Doc/whatsnew/3.14.rst Outdated

* Optimise the :func:`~textwrap.dedent` function, improving performance by
an average of 2.4x, with larger improvements for bigger inputs,
and fix a bug with incomplete normalization of blank lines with whitespace

@picnixz picnixz Mar 31, 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.

Maybe use two separate bullet points for that? so that the reader is able to distinguish between a performance improvement and a behavioral change.

Sorry, something went wrong.

Uh oh!

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

All reactions

@AA-Turner AA-Turner Mar 31, 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.

Where should the second one go? Improved Modules is mainly for features, and a standalone bullet about the bugfix in Optimisations feels wrong.

Sorry, something went wrong.

Uh oh!

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

All reactions

@picnixz picnixz Mar 31, 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.

Well, I think it's still an improvement in some sense (even if we didn't treat it as a regular bugfix that we backport). For me I think that the behavioral change is important to note, hence I suggested using two separate bullet points (but still under the same section)

Sorry, something went wrong.

Uh oh!

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

All reactions
@AA-Turner AA-Turner changed the title gh-130167: Add a What's New entry for the changes to textwrap.dedent gh-130167: Add a What's New entry for the changes to textwrap.{de,in}dent Apr 1, 2025
@AA-Turner AA-Turner changed the title gh-130167: Add a What's New entry for the changes to textwrap.{de,in}dent gh-130167: Add a What's New entry for changes to textwrap.{de,in}dent Apr 1, 2025
@python-cla-bot

python-cla-bot Bot commented Apr 6, 2025

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz

picnixz commented Apr 17, 2025

Copy link
Copy Markdown
Member

@AA-Turner Can you also include the typo fix of the NEWS entry (https://github.com/python/cpython/pull/131923/files#r2044429846)? TiA

All reactions

Sorry, something went wrong.

Uh oh!

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

@hugovk hugovk added the needs backport to 3.14 bugs and security fixes label Jun 27, 2025
@hugovk

hugovk commented Jun 27, 2025

Copy link
Copy Markdown
Member

Reminder for this :)

All reactions

Sorry, something went wrong.

Uh oh!

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

serhiy-storchaka
serhiy-storchaka approved these changes Dec 26, 2025
View reviewed changes

@serhiy-storchaka serhiy-storchaka 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.

LGTM. I have no opinion about normalised/normalized, please came to some conclusion.

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Dec 26, 2025
hugovk
hugovk reviewed Dec 28, 2025
View reviewed changes
Comment thread Doc/whatsnew/3.14.rst Resolved

Uh oh!

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

@hugovk @StanFromIreland
-ize
ff69b2f
Co-authored-by: Stan Ulbrych <[email protected]>
hugovk
hugovk approved these changes Dec 28, 2025
View reviewed changes
@hugovk

hugovk commented Dec 28, 2025

Copy link
Copy Markdown
Member

@AA-Turner Can you also include the typo fix of the NEWS entry (#131923 (files))? TiA

(Was fixed in #132666)

picnixz reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@hugovk
Merge branch 'main' into tw-dent-docs
2672f1a
picnixz
picnixz reviewed Dec 29, 2025
View reviewed changes
Comment thread Doc/whatsnew/3.14.rst Resolved

Uh oh!

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

StanFromIreland
StanFromIreland reviewed Dec 29, 2025
View reviewed changes
Comment thread Doc/whatsnew/3.14.rst Resolved

Uh oh!

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

picnixz
picnixz reviewed Dec 29, 2025
View reviewed changes
Comment thread Doc/library/textwrap.rst Resolved

Uh oh!

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

@hugovk @picnixz
Apply suggestions from code review
7f0f9a9
Co-authored-by: Bénédikt Tran <[email protected]>
@hugovk
hugovk merged commit 7e3a5a7 into python:main Dec 30, 2025
28 checks passed

Uh oh!

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

@miss-islington-app

miss-islington-app Bot commented Dec 30, 2025

Copy link
Copy Markdown

Thanks @AA-Turner for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label Dec 30, 2025
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Dec 30, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 30, 2025
@AA-Turner @StanFromIreland
@picnixz @hugovk @miss-islington
pythongh-130167: Add a What's New entry for changes to ``textwrap.{de…
8023175
…,in}dent`` (pythonGH-131924)

(cherry picked from commit 7e3a5a7)

Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
@bedevere-app

bedevere-app Bot commented Dec 30, 2025

Copy link
Copy Markdown

GH-143292 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Dec 30, 2025
hugovk added a commit that referenced this pull request Dec 30, 2025
@miss-islington @AA-Turner
@StanFromIreland @picnixz @hugovk
[3.14] gh-130167: Add a What's New entry for changes to ``textwrap.{d…
acd2846
…e,in}dent`` (GH-131924) (#143292)

Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request Feb 15, 2026
@AA-Turner @StanFromIreland
@picnixz @hugovk @thunder-coding
pythongh-130167: Add a What's New entry for changes to ``textwrap.{de…
c326bb5
…,in}dent`` (python#131924)

Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hugovk hugovk hugovk approved these changes
@picnixz picnixz picnixz left review comments
@StanFromIreland StanFromIreland StanFromIreland left review comments
@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip news

Projects

Docs PRs
Status: Done

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.

5 participants

@AA-Turner @picnixz @hugovk @serhiy-storchaka @StanFromIreland
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.