[Python-Dev] incorrect docstring for sys.int_info.sizeof_digit?

Pfeiffer, Phillip E., IV PHIL at mail.etsu.edu
Wed Jan 21 12:07:46 CET 2015


Apologies if this has already been reported; I couldn't find a readily searchable archive for this mailing list (and apologies if I've just missed it).

Issue: the docstring for sys.int_info_.sizeof_digit appears to be amiss; see below.

------
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>python
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:16:31) [MSC v.1600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> from sys import int_info
>>> print(sys.int_info.sizeof_digit.__doc__)
int(x=0) -> integer
int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments
are given.  If x is a number, return x.__int__().  For floating point
numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string,
bytes, or bytearray instance representing an integer literal in the
given base.  The literal can be preceded by '+' or '-' and be surrounded
by whitespace.  The base defaults to 10.  Valid bases are 0 and 2-36.
Base 0 means to interpret the base from the string as an integer literal.
>>> int('0b100', base=0)
4
>>>


-- Phil

===================
 Phil Pfeiffer/ East TN State U.                |  Kindness in thought leads to wisdom.
 Dept. of Computing / P.O. Box 70711   |  Kindness in speech leads to eloquence.
 Johnson City, TN.  37614-1266              |  Kindness in action leads to love.
phil (at) etsu.edu  (423) 439-5355           |                            -- Lao-Tsu


More information about the Python-Dev mailing list