Files
bits/src
S Groesz 741fc41f07 fix: Bits.__getitem__/__setitem__ ignore msb_last (rtl) as documented
list() always used MSB-first bit order regardless of the msb_last
constructor flag, so indexing/slicing on an instance built with
msb_last=True silently behaved identically to the default -- the
documented "swap bit order for indexing and slicing" never happened.
__setitem__ needed a matching fix: since __setvalue() always expects
a MSB-first list, a mutated LSB-first list from list() has to be
reversed back before being passed in.

Found while wiring bits.Bits into progpib's GPIB status-byte handling
(IEEE-488.2 bit numbering is LSB-first, e.g. RQS = bit 6).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-24 18:27:58 -05:00
..