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

Function _iter_bits_lsb

Lib/enum.py:115–125  ·  view source on GitHub ↗
(num)

Source from the content-addressed store, hash-verified

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

Callers 4

test_iter_bits_lsbMethod · 0.90
show_flag_valuesFunction · 0.85
__call__Method · 0.85

Calls

no outgoing calls

Tested by 1

test_iter_bits_lsbMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…