bpo-32397: new option for TextWrapper to allow stable wrapping#27587
Open
akulakov wants to merge 9 commits intopython:mainfrom
Open
bpo-32397: new option for TextWrapper to allow stable wrapping#27587akulakov wants to merge 9 commits intopython:mainfrom
akulakov wants to merge 9 commits intopython:mainfrom
Conversation
… tests for replace_whitespace and fold_space_newline
terryjreedy
reviewed
Aug 23, 2021
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Contributor
|
Could you re-target whatsnew for 3.12? |
Contributor
Author
|
@MaxwellDupre moved the what's new note from 3.11 to 3.12. |
Contributor
|
Built fresh with But fails: Traceback (most recent call last): Im on Fedora 5.18.6-200.fc36.x86_64 |
|
This PR is stale because it has been open for 30 days with no activity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The new option
fold_space_newlineperforms a more natural whitespace replacement for newlines, e.g.More importantly, it allows for "stable" wrapping when combined with
drop_whitespace=False, i.e. wrap() can be applied multiple times producing the same output (see the Issue).https://bugs.python.org/issue32397