(c: str)
| 7 | |
| 8 | @functools.cache |
| 9 | def str_width(c: str) -> int: |
| 10 | if ord(c) < 128: |
| 11 | return 1 |
| 12 | w = unicodedata.east_asian_width(c) |
| 13 | if w in ('N', 'Na', 'H', 'A'): |
| 14 | return 1 |
| 15 | return 2 |
| 16 | |
| 17 | |
| 18 | def wlen(s: str) -> int: |
no test coverage detected