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

Function _grouping_intervals

Lib/locale.py:121–134  ·  view source on GitHub ↗
(grouping)

Source from the content-addressed store, hash-verified

119
120# Iterate over grouping intervals
121def _grouping_intervals(grouping):
122 last_interval = None
123 for interval in grouping:
124 # if grouping is -1, we are done
125 if interval == CHAR_MAX:
126 return
127 # 0: re-use last group ad infinitum
128 if interval == 0:
129 if last_interval is None:
130 raise ValueError("invalid grouping")
131 while True:
132 yield last_interval
133 yield interval
134 last_interval = interval
135
136#perform the grouping from right to left
137def _group(s, monetary=False):

Callers 1

_groupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…