-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
bpo-32397: new option for TextWrapper to allow stable wrapping #27587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
bpo-32397: new option for TextWrapper to allow stable wrapping #27587
Conversation
… tests for replace_whitespace and fold_space_newline
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Could you re-target whatsnew for 3.12? |
@MaxwellDupre moved the what's new note from 3.11 to 3.12. |
Built fresh with But fails: Traceback (most recent call last): Im on Fedora 5.18.6-200.fc36.x86_64 |
The new option
fold_space_newline
performs 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