| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead. |
Sorry, something went wrong.
Sorry, something went wrong.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead. |
Sorry, something went wrong.
# Conflicts: # Doc/whatsnew/3.16.rst
Documentation build overview149 files changed · + 3 added · ± 146 modified + Added ± Modified |
Sorry, something went wrong.
For ANSI and variable character width awareness. Removes local patch introduced in python#154634.
For ANSI and variable character width awareness. Removes local patch introduced in python#154634.
For ANSI and variable character width awareness. Removes local patch introduced in python#154634.
| Back | FazBrowse Home | New Git URL |
Description
Add a text_len parameter to textwrap.wrap, textwrap.fill, textwrap.shorten and textwrap.TextWrapper. It customizes how the visible width of a string is measured, so text that contains zero-width or double-width characters, or invisible ANSI escape sequences, can be wrapped correctly.
This has the side effect of removing the local patch in _split_lines introduced by #154634 .
Context
I am a maintainer of Click and had to maintain my own local fork of TextWrapper to make it strip ANSI strings properly. See my initial code at: pallets/click#3420 . This PR is a direct port of that code to Python standard library.
This PR: