-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
gh-142035: Textwrap without ansi escapes #142040
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?
gh-142035: Textwrap without ansi escapes #142040
Conversation
21b7359 to
6517434
Compare
|
This is just a POC, it needs tests, docs, etc. >>> textwrap.wrap("Cafe\u0301 is good", width=4)
['Cafe', '́ is', 'good'] |
|
Sorry but we should not change |
|
Oh actually the patch is quite simple. However as it's a new feature we cannot backport it =/ so we need to think of a solution that can be backported. If it's not possible I would suggest:
If the PR is not ready, I will make it a draft. |
|
Thanks for the reply! I was not thinking about backporting the changes to 3.14 to be honest. The cleanest solution would be to incorporate a complete unicode handling with a technique similar to wcwidth, that would allow for proper wrapping of all glyphs. That being said, as this would be indeed a major addition to stdlib, a good first step might be to add the new option to |
|
Well.. looks like the current tests are broken which is not good. I need to think about the changes to @serhiy-storchaka Do you think it makes sense to make |
|
Sorry, the draft contained a bug due to a copy paste error, I just pushed a fix. |
Uh oh!
There was an error while loading. Please reload this page.