MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _grouping_intervals

Function _grouping_intervals

tools/python-3.11.9-amd64/Lib/locale.py:122–135  ·  view source on GitHub ↗
(grouping)

Source from the content-addressed store, hash-verified

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

Callers 1

_groupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected