This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients anon, hct, mark.dickinson, meador.inge, pitrou, rhettinger, serhiy.storchaka, tim.peters, vstinner
Date 2013-12-09.17:06:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1386608760.94.0.252127676305.issue19915@psf.upfronthosting.co.za>
In-reply-to
Content
@pitrou, I think usability is a lot more valuable than cross-feature "formal consistency" here.  I've been extracting bit fields for decades, and always think of them in terms of "least-significant bit and number of bits".  Perhaps the underlying difference is that nobody ever thinks of bit positions as being _between_ bits - instead we always think of "bit i" as being the bit with binary value 2**i.  It's more of a math concept than an indexing concept.

For a bit _array_ I'd agree slicing semantics would make more sense.  But Python ints have infinite width, and "index 0" is at the rightmost position (not the leftmost position - there is no leftmost position).

I'd also like to avoid the nuisance of having to implement all the goofy slicing possibilities, like non-unit strides and negative strides.  Not that they're "goofy" in general - they're goofy in the context of extracting bits from an integer.  Again a bit array is a different kind of beast.
History
Date User Action Args
2013-12-09 17:06:00tim.peterssetrecipients: + tim.peters, rhettinger, mark.dickinson, pitrou, vstinner, meador.inge, serhiy.storchaka, hct, anon
2013-12-09 17:06:00tim.peterssetmessageid: <1386608760.94.0.252127676305.issue19915@psf.upfronthosting.co.za>
2013-12-09 17:06:00tim.peterslinkissue19915 messages
2013-12-09 17:06:00tim.peterscreate