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 vstinner
Recipients anon, hct, josh.r, mark.dickinson, martin.panter, meador.inge, pitrou, rhettinger, serhiy.storchaka, tim.peters, vstinner
Date 2014-10-02.07:33:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1412235206.18.0.979221964423.issue19915@psf.upfronthosting.co.za>
In-reply-to
Content
I don't like the idea of the array-view int.bits[a:b]: it's harder to implement and the proposed behaviour is different than a list. Example:

>>> x=list("abcdef")
>>> x[2]
'c'
>>> x[2:4]
['c', 'd']

x[2:4] returns a subset of the list, so a new list. It doesn't return "cd". I would expect int.bits[a:b] to return a list of integers in range 0..1.

I prefer int.bits(bit, nbits=1), because it's more obvious that it returns an integer (and not a list) for nbits > 1.
History
Date User Action Args
2014-10-02 07:33:26vstinnersetrecipients: + vstinner, tim.peters, rhettinger, mark.dickinson, pitrou, meador.inge, martin.panter, serhiy.storchaka, hct, anon, josh.r
2014-10-02 07:33:26vstinnersetmessageid: <1412235206.18.0.979221964423.issue19915@psf.upfronthosting.co.za>
2014-10-02 07:33:26vstinnerlinkissue19915 messages
2014-10-02 07:33:25vstinnercreate