9 Commits

Author SHA1 Message Date
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
49ef87f8c9 add bit_len to Bytes 2021-04-17 05:01:32 +00:00
de7c42fe8f fix typo 2021-04-14 03:17:42 +00:00
d111d402db compatibility update for Python 3.6 2021-04-14 00:59:02 +00:00
c63d2dd4bb added hex methods 2021-04-13 06:41:39 +00:00
66aa7ee915 tests passing; improve doc 2020-11-23 07:51:45 +00:00
97f7d58dd7 Improve doc; add Bit.set and unset methods 2020-11-22 06:30:47 +00:00
3ad4435b3f update for pypi 2020-11-19 04:23:42 +00:00
42bb3f13e6 package 2020-10-28 06:45:49 +00:00