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

Function _iter_bits_lsb

tools/python-3.11.9-amd64/Lib/enum.py:117–127  ·  view source on GitHub ↗
(num)

Source from the content-addressed store, hash-verified

115 setattr(obj, '__module__', '<unknown>')
116
117def _iter_bits_lsb(num):
118 # num must be a positive integer
119 original = num
120 if isinstance(num, Enum):
121 num = num.value
122 if num < 0:
123 raise ValueError('%r is not a positive integer' % original)
124 while num:
125 b = num & (~num + 1)
126 yield b
127 num ^= b
128
129def show_flag_values(value):
130 return list(_iter_bits_lsb(value))

Callers 3

show_flag_valuesFunction · 0.85
__call__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected