Conversation
But i think that's ok -- mainly: we describe the specification of our wcwidth() and wcswidth() function. This includes that stuff.
I'll say, there are uses downstream, I see silly lines like:
for cp in range(1000000):
if wcwidth.wcwidth(cp) == 2:
wide_table.append(cp)
and they're going to suffer a bit from this, or they also benefit,
depending on context, but if they're "doing it wrong" they're probably
also not using iter_graphemes() anyway so there is no help
CodSpeed Performance ReportMerging this PR will degrade performance by 22.14%Comparing Summary
Performance Changes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #202 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 15 15
Lines 896 938 +42
Branches 227 239 +12
=========================================
+ Hits 896 938 +42 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
the frozenset, _EMOJI_ZWJ_SET is fastest
jquast
added a commit
to jquast/blessed
that referenced
this pull request
Feb 1, 2026
The boundary pattern in ``get_kitty_keyboard_state()`` used ``.+`` which matched prematurely! Existing tests didn't catch this because they use ungetch() which buffers the entire response jquast/wcwidth#200 jquast/wcwidth#202
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.
CLoses #133 and #154.
This decreases general performance by ~10% for complex CJK/combining and emoji strings.