Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a9da6d1

Browse files
committed
Merged revisions 67857 via svnmerge from
svn+ssh://[email protected]/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. ........
1 parent d3e18b7 commit a9da6d1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Doc/library/stdtypes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ Additional Methods on Integer Types
442442
Equivalent to::
443443

444444
def bit_length(self):
445-
s = bin(x) # binary representation: bin(-37) --> '-0b100101'
445+
s = bin(self) # binary representation: bin(-37) --> '-0b100101'
446446
s = s.lstrip('-0b') # remove leading zeros and minus sign
447447
return len(s) # len('100101') --> 6
448448

0 commit comments

Comments
 (0)