File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change 1515 (0x02800 , 0x028FF ), # Braille
1616]
1717
18-
19- def _make_single_cell_set () -> frozenset [str ]:
20- """Combine ranges of ordinals in to a frozen set of strings.
21-
22- Returns:
23- A frozenset of single cell characters.
24-
25- """
26- character_range_lists = [
27- list (map (chr , range (_start , _end + 1 )))
18+ # A set of characters that are a single cell wide
19+ _SINGLE_CELLS = frozenset (
20+ [
21+ character
2822 for _start , _end in _SINGLE_CELL_UNICODE_RANGES
23+ for character in map (chr , range (_start , _end + 1 ))
2924 ]
30- return frozenset (sum (character_range_lists , start = []))
31-
32-
33- # A set of characters that are a single cell wide
34- _SINGLE_CELLS = _make_single_cell_set ()
25+ )
3526
3627# When called with a string this will return True if all
3728# characters are single-cell, otherwise False
You can’t perform that action at this time.
0 commit comments