Merged revisions 67857 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r67857 | mark.dickinson | 2008-12-19 17:46:51 +0000 (Fri, 19 Dec 2008) | 2 lines

  Fix typo in Python equivalent for bit_length.
........
This commit is contained in:
Mark Dickinson 2008-12-19 17:48:51 +00:00
parent d3e18b7113
commit a9da6d1a7b
1 changed files with 1 additions and 1 deletions

View File

@ -442,7 +442,7 @@ Additional Methods on Integer Types
Equivalent to::
def bit_length(self):
s = bin(x) # binary representation: bin(-37) --> '-0b100101'
s = bin(self) # binary representation: bin(-37) --> '-0b100101'
s = s.lstrip('-0b') # remove leading zeros and minus sign
return len(s) # len('100101') --> 6