Message205425
I'd rather see `i.bits_at(pos, width=1)`, to act like
(i >> pos) & ((1 << width) - 1)
That is, extract the `width` consecutive bits at positions 2**pos through 2**(pos + width - 1) inclusive.
Because Python ints maintain the illusion of having an infinite number of sign bits, I don't think negative `pos` (or `width`) can be assigned a sensible meaning. Python ints only have "one end".
And, yup, I've often wanted this too! |
|
Date |
User |
Action |
Args |
2013-12-07 00:44:48 | tim.peters | set | recipients:
+ tim.peters, mark.dickinson, anon |
2013-12-07 00:44:47 | tim.peters | set | messageid: <1386377087.99.0.492690755043.issue19915@psf.upfronthosting.co.za> |
2013-12-07 00:44:47 | tim.peters | link | issue19915 messages |
2013-12-07 00:44:47 | tim.peters | create | |
|