MCPcopy Index your code
hub / github.com/python/cpython / expand_range

Function expand_range

Tools/unicode/makeunicodedata.py:924–934  ·  view source on GitHub ↗

Parses ranges of code points, as described in UAX #44: https://www.unicode.org/reports/tr44/#Code_Point_Ranges

(char_range: str)

Source from the content-addressed store, hash-verified

922
923
924def expand_range(char_range: str) -> Iterator[int]:
925 '''
926 Parses ranges of code points, as described in UAX #44:
927 https://www.unicode.org/reports/tr44/#Code_Point_Ranges
928 '''
929 if '..' in char_range:
930 first, last = [int(c, 16) for c in char_range.split('..')]
931 else:
932 first = last = int(char_range, 16)
933 for char in range(first, last+1):
934 yield char
935
936
937class UcdFile:

Callers 2

expandedMethod · 0.85
__init__Method · 0.85

Calls 1

splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…