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.

作者 zooko
收信人 fredrikj, mark.dickinson, pitrou, rhettinger, terry.reedy, vstinner, zooko
日期 2010-06-21.22:04:02
SpamBayes Score 0.010819301
Marked as misclassified
Message-id <1277157845.73.0.885521494438.issue3439@psf.upfronthosting.co.za>
In-reply-to
内容
There is a small mistake in the docs:

def bit_length(x):
    'Number of bits necessary to represent self in binary.'
    s = bin(x)          # binary representation:  bin(-37) --> '-0b100101'
    s = s.lstrip('-0b') # remove leading zeros and minus sign
    return len(s)       # len('100101') --> 6

is probably supposed to be:

def bit_length(x):
    'Number of bits necessary to represent x in binary.'
    s = bin(x)          # binary representation:  bin(-37) --> '-0b100101'
    s = s.lstrip('-0b') # remove leading zeros and minus sign
    return len(s)       # len('100101') --> 6
历史
日期 用户 动作 参数
2010-06-21 22:04:06zooko修改recipients: + zooko, rhettinger, terry.reedy, mark.dickinson, pitrou, vstinner, fredrikj
2010-06-21 22:04:05zooko修改messageid: <1277157845.73.0.885521494438.issue3439@psf.upfronthosting.co.za>
2010-06-21 22:04:03zooko链接issue3439 messages
2010-06-21 22:04:02zooko创建