summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Doc/library/msilib.rst3
-rw-r--r--Doc/library/xml.dom.pulldom.rst3
-rw-r--r--Doc/library/xml.dom.rst9
-rw-r--r--Doc/library/xml.etree.elementtree.rst5
-rw-r--r--Doc/library/xml.sax.handler.rst11
-rw-r--r--Doc/library/xml.sax.reader.rst31
-rw-r--r--Doc/library/xml.sax.rst35
-rw-r--r--Doc/library/xml.sax.utils.rst17
-rw-r--r--Include/abstract.h4
-rw-r--r--Include/longintrepr.h6
-rw-r--r--Include/longobject.h6
-rw-r--r--Include/objimpl.h2
-rw-r--r--Include/pyport.h4
-rw-r--r--Lib/asynchat.py9
-rw-r--r--Lib/ctypes/test/test_numbers.py2
-rw-r--r--Lib/datetime.py4
-rw-r--r--Lib/gzip.py2
-rw-r--r--Lib/pickle.py4
-rw-r--r--Lib/pickletools.py8
-rw-r--r--Lib/random.py2
-rw-r--r--Lib/tempfile.py2
-rw-r--r--Lib/test/pickletester.py4
-rw-r--r--Lib/test/support/__init__.py2
-rw-r--r--Lib/test/test_cmath.py2
-rw-r--r--Lib/test/test_compile.py2
-rw-r--r--Lib/test/test_decimal.py2
-rw-r--r--Lib/test/test_gdb.py2
-rw-r--r--Lib/test/test_httplib.py8
-rw-r--r--Lib/test/test_itertools.py14
-rw-r--r--Lib/test/test_logging.py7
-rw-r--r--Lib/test/test_long.py15
-rw-r--r--Lib/test/test_struct.py2
-rw-r--r--Lib/test/test_sys.py2
-rw-r--r--Lib/xmlrpc/client.py2
-rw-r--r--Misc/NEWS5
-rw-r--r--Modules/_ctypes/callproc.c2
-rw-r--r--Modules/_datetimemodule.c14
-rw-r--r--Modules/_pickle.c14
-rw-r--r--Modules/_randommodule.c2
-rw-r--r--Modules/_sqlite/connection.c3
-rw-r--r--Modules/_struct.c2
-rw-r--r--Modules/_testcapimodule.c2
-rw-r--r--Modules/mathmodule.c13
-rw-r--r--Modules/socketmodule.c8
-rw-r--r--Objects/abstract.c7
-rw-r--r--Objects/fileobject.c4
-rw-r--r--Objects/floatobject.c8
-rw-r--r--Objects/longobject.c100
-rw-r--r--Objects/rangeobject.c2
-rw-r--r--PC/pyconfig.h2
-rw-r--r--PC/winreg.c5
-rw-r--r--Python/bltinmodule.c2
-rw-r--r--Python/compile.c2
-rw-r--r--Python/formatter_unicode.c3
-rw-r--r--Python/marshal.c4
-rw-r--r--Tools/gdb/libpython.py2
56 files changed, 224 insertions, 215 deletions
diff --git a/Doc/library/msilib.rst b/Doc/library/msilib.rst
index 270f4ff9f2..efb666750c 100644
--- a/Doc/library/msilib.rst
+++ b/Doc/library/msilib.rst
@@ -88,8 +88,7 @@ structures.
record according to the schema of the table. For optional fields,
``None`` can be passed.
- Field values can be int or long numbers, strings, or instances of the Binary
- class.
+ Field values can be ints, strings, or instances of the Binary class.
.. class:: Binary(filename)
diff --git a/Doc/library/xml.dom.pulldom.rst b/Doc/library/xml.dom.pulldom.rst
index 8aa9cfb7d5..a9c9f67a71 100644
--- a/Doc/library/xml.dom.pulldom.rst
+++ b/Doc/library/xml.dom.pulldom.rst
@@ -74,7 +74,8 @@ and switch to DOM-related processing.
Return a :class:`DOMEventStream` from the given input. *stream_or_string* may be
either a file name, or a file-like object. *parser*, if given, must be a
- :class:`XmlReader` object. This function will change the document handler of the
+ :class:`~xml.sax.xmlreader.XMLReader` object. This function will change the
+ document handler of the
parser and activate namespace support; other parser configuration (like
setting an entity resolver) must have been done in advance.
diff --git a/Doc/library/xml.dom.rst b/Doc/library/xml.dom.rst
index 1a3a6a4b1f..19512ed3f7 100644
--- a/Doc/library/xml.dom.rst
+++ b/Doc/library/xml.dom.rst
@@ -422,14 +422,15 @@ objects:
In addition, the Python DOM interface requires that some additional support is
provided to allow :class:`NodeList` objects to be used as Python sequences. All
-:class:`NodeList` implementations must include support for :meth:`__len__` and
-:meth:`__getitem__`; this allows iteration over the :class:`NodeList` in
+:class:`NodeList` implementations must include support for
+:meth:`~object.__len__` and
+:meth:`~object.__getitem__`; this allows iteration over the :class:`NodeList` in
:keyword:`for` statements and proper support for the :func:`len` built-in
function.
If a DOM implementation supports modification of the document, the
-:class:`NodeList` implementation must also support the :meth:`__setitem__` and
-:meth:`__delitem__` methods.
+:class:`NodeList` implementation must also support the
+:meth:`~object.__setitem__` and :meth:`~object.__delitem__` methods.
.. _dom-documenttype-objects:
diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst
index d0b59efb08..7270067bf6 100644
--- a/Doc/library/xml.etree.elementtree.rst
+++ b/Doc/library/xml.etree.elementtree.rst
@@ -664,8 +664,9 @@ Element Objects
or contents.
:class:`Element` objects also support the following sequence type methods
- for working with subelements: :meth:`__delitem__`, :meth:`__getitem__`,
- :meth:`__setitem__`, :meth:`__len__`.
+ for working with subelements: :meth:`~object.__delitem__`,
+ :meth:`~object.__getitem__`, :meth:`~object.__setitem__`,
+ :meth:`~object.__len__`.
Caution: Elements with no subelements will test as ``False``. This behavior
will change in future versions. Use specific ``len(elem)`` or ``elem is
diff --git a/Doc/library/xml.sax.handler.rst b/Doc/library/xml.sax.handler.rst
index 1a6b391c07..0fb3341c61 100644
--- a/Doc/library/xml.sax.handler.rst
+++ b/Doc/library/xml.sax.handler.rst
@@ -237,7 +237,8 @@ events in the input document:
Signals the start of an element in non-namespace mode.
The *name* parameter contains the raw XML 1.0 name of the element type as a
- string and the *attrs* parameter holds an object of the :class:`Attributes`
+ string and the *attrs* parameter holds an object of the
+ :class:`~xml.sax.xmlreader.Attributes`
interface (see :ref:`attributes-objects`) containing the attributes of
the element. The object passed as *attrs* may be re-used by the parser; holding
on to a reference to it is not a reliable way to keep a copy of the attributes.
@@ -260,7 +261,8 @@ events in the input document:
The *name* parameter contains the name of the element type as a ``(uri,
localname)`` tuple, the *qname* parameter contains the raw XML 1.0 name used in
the source document, and the *attrs* parameter holds an instance of the
- :class:`AttributesNS` interface (see :ref:`attributes-ns-objects`)
+ :class:`~xml.sax.xmlreader.AttributesNS` interface (see
+ :ref:`attributes-ns-objects`)
containing the attributes of the element. If no namespace is associated with
the element, the *uri* component of *name* will be ``None``. The object passed
as *attrs* may be re-used by the parser; holding on to a reference to it is not
@@ -376,8 +378,9 @@ ErrorHandler Objects
--------------------
Objects with this interface are used to receive error and warning information
-from the :class:`XMLReader`. If you create an object that implements this
-interface, then register the object with your :class:`XMLReader`, the parser
+from the :class:`~xml.sax.xmlreader.XMLReader`. If you create an object that
+implements this interface, then register the object with your
+:class:`~xml.sax.xmlreader.XMLReader`, the parser
will call the methods in your object to report all warnings and errors. There
are three levels of errors available: warnings, (possibly) recoverable errors,
and unrecoverable errors. All methods take a :exc:`SAXParseException` as the
diff --git a/Doc/library/xml.sax.reader.rst b/Doc/library/xml.sax.reader.rst
index 6683da1aef..3ab60636c5 100644
--- a/Doc/library/xml.sax.reader.rst
+++ b/Doc/library/xml.sax.reader.rst
@@ -106,47 +106,50 @@ The :class:`XMLReader` interface supports the following methods:
.. method:: XMLReader.getContentHandler()
- Return the current :class:`ContentHandler`.
+ Return the current :class:`~xml.sax.handler.ContentHandler`.
.. method:: XMLReader.setContentHandler(handler)
- Set the current :class:`ContentHandler`. If no :class:`ContentHandler` is set,
- content events will be discarded.
+ Set the current :class:`~xml.sax.handler.ContentHandler`. If no
+ :class:`~xml.sax.handler.ContentHandler` is set, content events will be
+ discarded.
.. method:: XMLReader.getDTDHandler()
- Return the current :class:`DTDHandler`.
+ Return the current :class:`~xml.sax.handler.DTDHandler`.
.. method:: XMLReader.setDTDHandler(handler)
- Set the current :class:`DTDHandler`. If no :class:`DTDHandler` is set, DTD
+ Set the current :class:`~xml.sax.handler.DTDHandler`. If no
+ :class:`~xml.sax.handler.DTDHandler` is set, DTD
events will be discarded.
.. method:: XMLReader.getEntityResolver()
- Return the current :class:`EntityResolver`.
+ Return the current :class:`~xml.sax.handler.EntityResolver`.
.. method:: XMLReader.setEntityResolver(handler)
- Set the current :class:`EntityResolver`. If no :class:`EntityResolver` is set,
+ Set the current :class:`~xml.sax.handler.EntityResolver`. If no
+ :class:`~xml.sax.handler.EntityResolver` is set,
attempts to resolve an external entity will result in opening the system
identifier for the entity, and fail if it is not available.
.. method:: XMLReader.getErrorHandler()
- Return the current :class:`ErrorHandler`.
+ Return the current :class:`~xml.sax.handler.ErrorHandler`.
.. method:: XMLReader.setErrorHandler(handler)
- Set the current error handler. If no :class:`ErrorHandler` is set, errors will
- be raised as exceptions, and warnings will be printed.
+ Set the current error handler. If no :class:`~xml.sax.handler.ErrorHandler`
+ is set, errors will be raised as exceptions, and warnings will be printed.
.. method:: XMLReader.setLocale(locale)
@@ -322,9 +325,11 @@ InputSource Objects
The :class:`Attributes` Interface
---------------------------------
-:class:`Attributes` objects implement a portion of the mapping protocol,
-including the methods :meth:`copy`, :meth:`get`, :meth:`__contains__`,
-:meth:`items`, :meth:`keys`, and :meth:`values`. The following methods
+:class:`Attributes` objects implement a portion of the :term:`mapping protocol
+<mapping>`, including the methods :meth:`~collections.abc.Mapping.copy`,
+:meth:`~collections.abc.Mapping.get`, :meth:`~object.__contains__`,
+:meth:`~collections.abc.Mapping.items`, :meth:`~collections.abc.Mapping.keys`,
+and :meth:`~collections.abc.Mapping.values`. The following methods
are also provided:
diff --git a/Doc/library/xml.sax.rst b/Doc/library/xml.sax.rst
index d5c56b6966..e95d6b0f85 100644
--- a/Doc/library/xml.sax.rst
+++ b/Doc/library/xml.sax.rst
@@ -26,7 +26,8 @@ The convenience functions are:
.. function:: make_parser(parser_list=[])
- Create and return a SAX :class:`XMLReader` object. The first parser found will
+ Create and return a SAX :class:`~xml.sax.xmlreader.XMLReader` object. The
+ first parser found will
be used. If *parser_list* is provided, it must be a sequence of strings which
name modules that have a function named :func:`create_parser`. Modules listed
in *parser_list* will be used before modules in the default list of parsers.
@@ -36,8 +37,9 @@ The convenience functions are:
Create a SAX parser and use it to parse a document. The document, passed in as
*filename_or_stream*, can be a filename or a file object. The *handler*
- parameter needs to be a SAX :class:`ContentHandler` instance. If
- *error_handler* is given, it must be a SAX :class:`ErrorHandler` instance; if
+ parameter needs to be a SAX :class:`~handler.ContentHandler` instance. If
+ *error_handler* is given, it must be a SAX :class:`~handler.ErrorHandler`
+ instance; if
omitted, :exc:`SAXParseException` will be raised on all errors. There is no
return value; all work must be done by the *handler* passed in.
@@ -62,10 +64,12 @@ For these objects, only the interfaces are relevant; they are normally not
instantiated by the application itself. Since Python does not have an explicit
notion of interface, they are formally introduced as classes, but applications
may use implementations which do not inherit from the provided classes. The
-:class:`InputSource`, :class:`Locator`, :class:`Attributes`,
-:class:`AttributesNS`, and :class:`XMLReader` interfaces are defined in the
+:class:`~xml.sax.xmlreader.InputSource`, :class:`~xml.sax.xmlreader.Locator`,
+:class:`~xml.sax.xmlreader.Attributes`, :class:`~xml.sax.xmlreader.AttributesNS`,
+and :class:`~xml.sax.xmlreader.XMLReader` interfaces are defined in the
module :mod:`xml.sax.xmlreader`. The handler interfaces are defined in
-:mod:`xml.sax.handler`. For convenience, :class:`InputSource` (which is often
+:mod:`xml.sax.handler`. For convenience,
+:class:`~xml.sax.xmlreader.InputSource` (which is often
instantiated directly) and the handler classes are also available from
:mod:`xml.sax`. These interfaces are described below.
@@ -78,7 +82,8 @@ classes.
Encapsulate an XML error or warning. This class can contain basic error or
warning information from either the XML parser or the application: it can be
subclassed to provide additional functionality or to add localization. Note
- that although the handlers defined in the :class:`ErrorHandler` interface
+ that although the handlers defined in the
+ :class:`~xml.sax.handler.ErrorHandler` interface
receive instances of this exception, it is not required to actually raise the
exception --- it is also useful as a container for information.
@@ -91,22 +96,26 @@ classes.
.. exception:: SAXParseException(msg, exception, locator)
- Subclass of :exc:`SAXException` raised on parse errors. Instances of this class
- are passed to the methods of the SAX :class:`ErrorHandler` interface to provide
- information about the parse error. This class supports the SAX :class:`Locator`
- interface as well as the :class:`SAXException` interface.
+ Subclass of :exc:`SAXException` raised on parse errors. Instances of this
+ class are passed to the methods of the SAX
+ :class:`~xml.sax.handler.ErrorHandler` interface to provide information
+ about the parse error. This class supports the SAX
+ :class:`~xml.sax.xmlreader.Locator` interface as well as the
+ :class:`SAXException` interface.
.. exception:: SAXNotRecognizedException(msg, exception=None)
- Subclass of :exc:`SAXException` raised when a SAX :class:`XMLReader` is
+ Subclass of :exc:`SAXException` raised when a SAX
+ :class:`~xml.sax.xmlreader.XMLReader` is
confronted with an unrecognized feature or property. SAX applications and
extensions may use this class for similar purposes.
.. exception:: SAXNotSupportedException(msg, exception=None)
- Subclass of :exc:`SAXException` raised when a SAX :class:`XMLReader` is asked to
+ Subclass of :exc:`SAXException` raised when a SAX
+ :class:`~xml.sax.xmlreader.XMLReader` is asked to
enable a feature that is not supported, or to set a property to a value that the
implementation does not support. SAX applications and extensions may use this
class for similar purposes.
diff --git a/Doc/library/xml.sax.utils.rst b/Doc/library/xml.sax.utils.rst
index 0a4038cbef..14cf07839b 100644
--- a/Doc/library/xml.sax.utils.rst
+++ b/Doc/library/xml.sax.utils.rst
@@ -52,7 +52,8 @@ or as base classes.
.. class:: XMLGenerator(out=None, encoding='iso-8859-1', short_empty_elements=False)
- This class implements the :class:`ContentHandler` interface by writing SAX
+ This class implements the :class:`~xml.sax.handler.ContentHandler` interface
+ by writing SAX
events back into an XML document. In other words, using an :class:`XMLGenerator`
as the content handler will reproduce the original document being parsed. *out*
should be a file-like object which will default to *sys.stdout*. *encoding* is
@@ -67,7 +68,8 @@ or as base classes.
.. class:: XMLFilterBase(base)
- This class is designed to sit between an :class:`XMLReader` and the client
+ This class is designed to sit between an
+ :class:`~xml.sax.xmlreader.XMLReader` and the client
application's event handlers. By default, it does nothing but pass requests up
to the reader and events on to the handlers unmodified, but subclasses can
override specific methods to modify the event stream or the configuration
@@ -76,9 +78,10 @@ or as base classes.
.. function:: prepare_input_source(source, base='')
- This function takes an input source and an optional base URL and returns a fully
- resolved :class:`InputSource` object ready for reading. The input source can be
- given as a string, a file-like object, or an :class:`InputSource` object;
- parsers will use this function to implement the polymorphic *source* argument to
- their :meth:`parse` method.
+ This function takes an input source and an optional base URL and returns a
+ fully resolved :class:`~xml.sax.xmlreader.InputSource` object ready for
+ reading. The input source can be given as a string, a file-like object, or
+ an :class:`~xml.sax.xmlreader.InputSource` object; parsers will use this
+ function to implement the polymorphic *source* argument to their
+ :meth:`parse` method.
diff --git a/Include/abstract.h b/Include/abstract.h
index 44b5af72c9..c9624f32b2 100644
--- a/Include/abstract.h
+++ b/Include/abstract.h
@@ -771,7 +771,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
PyAPI_FUNC(PyObject *) PyNumber_Index(PyObject *o);
/*
- Returns the object converted to a Python long or int
+ Returns the object converted to a Python int
or NULL with an error raised on failure.
*/
@@ -780,7 +780,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/*
Returns the object converted to Py_ssize_t by going through
PyNumber_Index first. If an overflow error occurs while
- converting the int-or-long to Py_ssize_t, then the second argument
+ converting the int to Py_ssize_t, then the second argument
is the error-type to return. If it is NULL, then the overflow error
is cleared and the value is clipped.
*/
diff --git a/Include/longintrepr.h b/Include/longintrepr.h
index 3a45badeb7..bbba4d8ddd 100644
--- a/Include/longintrepr.h
+++ b/Include/longintrepr.h
@@ -8,7 +8,7 @@ extern "C" {
/* This is published for the benefit of "friends" marshal.c and _decimal.c. */
-/* Parameters of the long integer representation. There are two different
+/* Parameters of the integer representation. There are two different
sets of parameters: one set for 30-bit digits, stored in an unsigned 32-bit
integer type, and one set for 15-bit digits with each digit stored in an
unsigned short. The value of PYLONG_BITS_IN_DIGIT, defined either at
@@ -29,7 +29,7 @@ extern "C" {
of bits in an unsigned long, as do the PyLong <-> long (or unsigned long)
conversion functions
- - the long <-> size_t/Py_ssize_t conversion functions expect that
+ - the Python int <-> size_t/Py_ssize_t conversion functions expect that
PyLong_SHIFT is strictly less than the number of bits in a size_t
- the marshal code currently expects that PyLong_SHIFT is a multiple of 15
@@ -83,7 +83,7 @@ typedef long stwodigits; /* signed variant of twodigits */
so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available.
CAUTION: Generic code manipulating subtypes of PyVarObject has to
- aware that longs abuse ob_size's sign bit.
+ aware that ints abuse ob_size's sign bit.
*/
struct _longobject {
diff --git a/Include/longobject.h b/Include/longobject.h
index bcb93b9e2d..fbe738cd2c 100644
--- a/Include/longobject.h
+++ b/Include/longobject.h
@@ -113,7 +113,7 @@ PyAPI_FUNC(size_t) _PyLong_NumBits(PyObject *v);
PyAPI_FUNC(PyObject *) _PyLong_DivmodNear(PyObject *, PyObject *);
/* _PyLong_FromByteArray: View the n unsigned bytes as a binary integer in
- base 256, and return a Python long with the same numeric value.
+ base 256, and return a Python int with the same numeric value.
If n is 0, the integer is 0. Else:
If little_endian is 1/true, bytes[n-1] is the MSB and bytes[0] the LSB;
else (little_endian is 0/false) bytes[0] is the MSB and bytes[n-1] the
@@ -123,7 +123,7 @@ PyAPI_FUNC(PyObject *) _PyLong_DivmodNear(PyObject *, PyObject *);
non-negative if bit 0x80 of the MSB is clear, negative if set.
Error returns:
+ Return NULL with the appropriate exception set if there's not
- enough memory to create the Python long.
+ enough memory to create the Python int.
*/
PyAPI_FUNC(PyObject *) _PyLong_FromByteArray(
const unsigned char* bytes, size_t n,
@@ -173,7 +173,7 @@ PyAPI_FUNC(int) _PyLong_FormatAdvancedWriter(
Py_ssize_t end);
#endif /* Py_LIMITED_API */
-/* These aren't really part of the long object, but they're handy. The
+/* These aren't really part of the int object, but they're handy. The
functions are in Python/mystrtoul.c.
*/
PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int);
diff --git a/Include/objimpl.h b/Include/objimpl.h
index 3d5f509404..c6b7df4aa5 100644
--- a/Include/objimpl.h
+++ b/Include/objimpl.h
@@ -171,7 +171,7 @@ PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t);
value is rounded up to the closest multiple of sizeof(void *), in order to
ensure that pointer fields at the end of the object are correctly aligned
for the platform (this is of special importance for subclasses of, e.g.,
- str or long, so that pointers can be stored after the embedded data).
+ str or int, so that pointers can be stored after the embedded data).
Note that there's no memory wastage in doing this, as malloc has to
return (at worst) pointer-aligned memory anyway.
diff --git a/Include/pyport.h b/Include/pyport.h
index e4e3601d7b..a5edea978a 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -80,7 +80,7 @@ Used in: PY_LONG_LONG
#endif
#endif /* HAVE_LONG_LONG */
-/* a build with 30-bit digits for Python long integers needs an exact-width
+/* a build with 30-bit digits for Python integers needs an exact-width
* 32-bit unsigned integer type to store those digits. (We could just use
* type 'unsigned long', but that would be wasteful on a system where longs
* are 64-bits.) On Unix systems, the autoconf macro AC_TYPE_UINT32_T defines
@@ -98,7 +98,7 @@ Used in: PY_LONG_LONG
#endif
/* Macros for a 64-bit unsigned integer type; used for type 'twodigits' in the
- * long integer implementation, when 30-bit digits are enabled.
+ * integer implementation, when 30-bit digits are enabled.
*/
#ifdef uint64_t
#define HAVE_UINT64_T 1
diff --git a/Lib/asynchat.py b/Lib/asynchat.py
index 4e26bb5856..eea3418762 100644
--- a/Lib/asynchat.py
+++ b/Lib/asynchat.py
@@ -69,12 +69,9 @@ class async_chat (asyncore.dispatcher):
# for string terminator matching
self.ac_in_buffer = b''
- # we use a list here rather than cStringIO for a few reasons...
- # del lst[:] is faster than sio.truncate(0)
- # lst = [] is faster than sio.truncate(0)
- # cStringIO will be gaining unicode support in py3k, which
- # will negatively affect the performance of bytes compared to
- # a ''.join() equivalent
+ # we use a list here rather than io.BytesIO for a few reasons...
+ # del lst[:] is faster than bio.truncate(0)
+ # lst = [] is faster than bio.truncate(0)
self.incoming = []
# we toss the use of the "simple producer" and replace it with
diff --git a/Lib/ctypes/test/test_numbers.py b/Lib/ctypes/test/test_numbers.py
index e697a254ba..c02abf9c32 100644
--- a/Lib/ctypes/test/test_numbers.py
+++ b/Lib/ctypes/test/test_numbers.py
@@ -104,7 +104,7 @@ class NumberTestCase(unittest.TestCase):
def test_floats(self):
# c_float and c_double can be created from
- # Python int, long and float
+ # Python int and float
class FloatLike(object):
def __float__(self):
return 2.0
diff --git a/Lib/datetime.py b/Lib/datetime.py
index 4bba70b068..d1f353be10 100644
--- a/Lib/datetime.py
+++ b/Lib/datetime.py
@@ -287,7 +287,7 @@ class timedelta:
- add, subtract timedelta
- unary plus, minus, abs
- compare to timedelta
- - multiply, divide by int/long
+ - multiply, divide by int
In addition, datetime supports subtraction of two datetime objects
returning a timedelta, and addition or subtraction of a datetime
@@ -1290,7 +1290,7 @@ class datetime(date):
"""datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])
The year, month and day arguments are required. tzinfo may be None, or an
- instance of a tzinfo subclass. The remaining arguments may be ints or longs.
+ instance of a tzinfo subclass. The remaining arguments may be ints.
"""
__slots__ = date.__slots__ + (
diff --git a/Lib/gzip.py b/Lib/gzip.py
index 67fe1d47c7..2fd03fa747 100644
--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -144,7 +144,7 @@ class GzipFile(io.BufferedIOBase):
non-trivial value.
The new class instance is based on fileobj, which can be a regular
- file, a StringIO object, or any other object which simulates a file.
+ file, an io.BytesIO object, or any other object which simulates a file.
It defaults to None, in which case filename is opened to provide
a file object.
diff --git a/Lib/pickle.py b/Lib/pickle.py
index 1d8185c6c6..d62f014a67 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -1270,7 +1270,7 @@ class _Unpickler:
raise _Stop(value)
dispatch[STOP[0]] = load_stop
-# Encode/decode longs.
+# Encode/decode ints.
def encode_long(x):
r"""Encode a long to a two's complement little-endian binary string.
@@ -1303,7 +1303,7 @@ def encode_long(x):
return result
def decode_long(data):
- r"""Decode a long from a two's complement little-endian binary string.
+ r"""Decode an int from a two's complement little-endian binary string.
>>> decode_long(b'')
0
diff --git a/Lib/pickletools.py b/Lib/pickletools.py
index 7351c8d290..612fa8f27e 100644
--- a/Lib/pickletools.py
+++ b/Lib/pickletools.py
@@ -580,16 +580,12 @@ def read_decimalnl_short(f):
>>> read_decimalnl_short(io.BytesIO(b"1234L\n56"))
Traceback (most recent call last):
...
- ValueError: trailing 'L' not allowed in b'1234L'
+ ValueError: invalid literal for int() with base 10: b'1234L'
"""
s = read_stringnl(f, decode=False, stripquotes=False)
- if s.endswith(b"L"):
- raise ValueError("trailing 'L' not allowed in %r" % s)
- # It's not necessarily true that the result fits in a Python short int:
- # the pickle may have been written on a 64-bit box. There's also a hack
- # for True and False here.
+ # There's a hack for True and False here.
if s == b"00":
return False
elif s == b"01":
diff --git a/Lib/random.py b/Lib/random.py
index 7d8d4f3a40..cf83114b89 100644
--- a/Lib/random.py
+++ b/Lib/random.py
@@ -633,7 +633,7 @@ class SystemRandom(Random):
return (int.from_bytes(_urandom(7), 'big') >> 3) * RECIP_BPF
def getrandbits(self, k):
- """getrandbits(k) -> x. Generates a long int with k random bits."""
+ """getrandbits(k) -> x. Generates an int with k random bits."""
if k <= 0:
raise ValueError('number of bits must be greater than zero')
if k != int(k):
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index ed5c857a1d..8a165ed1c1 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -521,7 +521,7 @@ class SpooledTemporaryFile:
# The method caching trick from NamedTemporaryFile
# won't work here, because _file may change from a
- # _StringIO instance to a real file. So we list
+ # BytesIO/StringIO instance to a real file. So we list
# all the methods directly.
# Context management protocol
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 342346291e..052290d764 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -1547,14 +1547,14 @@ class AbstractPicklerUnpicklerObjectTests(unittest.TestCase):
pickler.dump(data)
first_pickled = f.getvalue()
- # Reset StringIO object.
+ # Reset BytesIO object.
f.seek(0)
f.truncate()
pickler.dump(data)
second_pickled = f.getvalue()
- # Reset the Pickler and StringIO objects.
+ # Reset the Pickler and BytesIO objects.
pickler.clear_memo()
f.seek(0)
f.truncate()
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 1ab2136242..956fe988cc 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -430,6 +430,8 @@ def _requires_unix_version(sysname, min_version):
raise unittest.SkipTest(
"%s version %s or higher required, not %s"
% (sysname, min_version_txt, version_txt))
+ return func(*args, **kw)
+ wrapper.min_version = min_version
return wrapper
return decorator
diff --git a/Lib/test/test_cmath.py b/Lib/test/test_cmath.py
index 692ea361f4..4db6b2b991 100644
--- a/Lib/test/test_cmath.py
+++ b/Lib/test/test_cmath.py
@@ -253,7 +253,7 @@ class CMathTests(unittest.TestCase):
self.assertRaises(SomeException, f, MyComplexExceptionOS())
def test_input_type(self):
- # ints and longs should be acceptable inputs to all cmath
+ # ints should be acceptable inputs to all cmath
# functions, by virtue of providing a __float__ method
for f in self.test_functions:
for arg in [2, 2.]:
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 1071f4ab1a..ccd08db667 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -198,7 +198,7 @@ if 1:
else:
self.fail("How many bits *does* this machine have???")
# Verify treatment of constant folding on -(sys.maxsize+1)
- # i.e. -2147483648 on 32 bit platforms. Should return int, not long.
+ # i.e. -2147483648 on 32 bit platforms. Should return int.
self.assertIsInstance(eval("%s" % (-sys.maxsize - 1)), int)
self.assertIsInstance(eval("%s" % (-sys.maxsize - 2)), int)
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index 50a9ad4362..71b93a661b 100644
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -1838,7 +1838,7 @@ class UsabilityTest(unittest.TestCase):
self.assertIs(max(d1,d2), d2)
self.assertIs(max(d2,d1), d2)
- #between Decimal and long
+ #between Decimal and int
self.assertIs(min(d1,l2), d1)
self.assertIs(min(l2,d1), d1)
self.assertIs(max(l1,d2), d2)
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index abcb23e7a6..6c3f467d15 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -227,7 +227,7 @@ class PrettyPrintTests(DebuggerTests):
% (gdb_repr, exp_repr, gdb_output)))
def test_int(self):
- 'Verify the pretty-printing of various "int"/long values'
+ 'Verify the pretty-printing of various int values'
self.assertGdbRepr(42)
self.assertGdbRepr(0)
self.assertGdbRepr(-7)
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
index 863e4bc22b..769ab13fca 100644
--- a/Lib/test/test_httplib.py
+++ b/Lib/test/test_httplib.py
@@ -51,8 +51,8 @@ class EPipeSocket(FakeSocket):
def close(self):
pass
-class NoEOFStringIO(io.BytesIO):
- """Like StringIO, but raises AssertionError on EOF.
+class NoEOFBytesIO(io.BytesIO):
+ """Like BytesIO, but raises AssertionError on EOF.
This is used below to test that http.client doesn't try to read
more from the underlying file than it should.
@@ -324,7 +324,7 @@ class BasicTest(TestCase):
'HTTP/1.1 200 OK\r\n'
'Content-Length: 14432\r\n'
'\r\n',
- NoEOFStringIO)
+ NoEOFBytesIO)
resp = client.HTTPResponse(sock, method="HEAD")
resp.begin()
if resp.read():
@@ -337,7 +337,7 @@ class BasicTest(TestCase):
'HTTP/1.1 200 OK\r\n'
'Content-Length: 14432\r\n'
'\r\n',
- NoEOFStringIO)
+ NoEOFBytesIO)
resp = client.HTTPResponse(sock, method="HEAD")
resp.begin()
b = bytearray(5)
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index 53926a9df5..514a6b7a20 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -505,9 +505,9 @@ class TestBasicOps(unittest.TestCase):
self.assertEqual(repr(count(10.25)), 'count(10.25)')
self.assertEqual(next(c), -8)
for i in (-sys.maxsize-5, -sys.maxsize+5 ,-10, -1, 0, 10, sys.maxsize-5, sys.maxsize+5):
- # Test repr (ignoring the L in longs)
- r1 = repr(count(i)).replace('L', '')
- r2 = 'count(%r)'.__mod__(i).replace('L', '')
+ # Test repr
+ r1 = repr(count(i))
+ r2 = 'count(%r)'.__mod__(i)
self.assertEqual(r1, r2)
# check copy, deepcopy, pickle
@@ -555,12 +555,12 @@ class TestBasicOps(unittest.TestCase):
self.assertEqual(repr(count(10.5, 1.00)), 'count(10.5, 1.0)') # do show float values lilke 1.0
for i in (-sys.maxsize-5, -sys.maxsize+5 ,-10, -1, 0, 10, sys.maxsize-5, sys.maxsize+5):
for j in (-sys.maxsize-5, -sys.maxsize+5 ,-10, -1, 0, 1, 10, sys.maxsize-5, sys.maxsize+5):
- # Test repr (ignoring the L in longs)
- r1 = repr(count(i, j)).replace('L', '')
+ # Test repr
+ r1 = repr(count(i, j))
if j == 1:
- r2 = ('count(%r)' % i).replace('L', '')
+ r2 = ('count(%r)' % i)
else:
- r2 = ('count(%r, %r)' % (i, j)).replace('L', '')
+ r2 = ('count(%r, %r)' % (i, j))
self.assertEqual(r1, r2)
self.pickletest(count(i, j))
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index c9a051ae9f..ae4ca18444 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -156,12 +156,7 @@ class BaseTest(unittest.TestCase):
the expected_values list of tuples."""
stream = stream or self.stream
pat = re.compile(self.expected_log_pat)
- try:
- stream.reset()
- actual_lines = stream.readlines()
- except AttributeError:
- # StringIO.StringIO lacks a reset() method.
- actual_lines = stream.getvalue().splitlines()
+ actual_lines = stream.getvalue().splitlines()
self.assertEqual(len(actual_lines), len(expected_values))
for actual, expected in zip(actual_lines, expected_values):
match = pat.search(actual)
diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py
index b417bea215..baf1d6a3b2 100644
--- a/Lib/test/test_long.py
+++ b/Lib/test/test_long.py
@@ -322,20 +322,13 @@ class LongTest(unittest.TestCase):
"".join("0123456789abcdef"[i] for i in digits)
def check_format_1(self, x):
- for base, mapper in (8, oct), (10, repr), (16, hex):
+ for base, mapper in (2, bin), (8, oct), (10, str), (10, repr), (16, hex):
got = mapper(x)
expected = self.slow_format(x, base)
msg = Frm("%s returned %r but expected %r for %r",
mapper.__name__, got, expected, x)
self.assertEqual(got, expected, msg)
self.assertEqual(int(got, 0), x, Frm('int("%s", 0) != %r', got, x))
- # str() has to be checked a little differently since there's no
- # trailing "L"
- got = str(x)
- expected = self.slow_format(x, 10)
- msg = Frm("%s returned %r but expected %r for %r",
- mapper.__name__, got, expected, x)
- self.assertEqual(got, expected, msg)
def test_format(self):
for x in special:
@@ -553,11 +546,11 @@ class LongTest(unittest.TestCase):
def test_mixed_compares(self):
eq = self.assertEqual
- # We're mostly concerned with that mixing floats and longs does the
- # right stuff, even when longs are too large to fit in a float.
+ # We're mostly concerned with that mixing floats and ints does the
+ # right stuff, even when ints are too large to fit in a float.
# The safest way to check the results is to use an entirely different
# method, which we do here via a skeletal rational class (which
- # represents all Python ints, longs and floats exactly).
+ # represents all Python ints and floats exactly).
class Rat:
def __init__(self, value):
if isinstance(value, int):
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
index 22374d244d..50cae052f3 100644
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -278,7 +278,7 @@ class StructTest(unittest.TestCase):
# Objects with an '__index__' method should be allowed
# to pack as integers. That is assuming the implemented
- # '__index__' method returns and 'int' or 'long'.
+ # '__index__' method returns an 'int'.
class Indexable(object):
def __init__(self, value):
self._value = value
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index 9d97c8d363..bc4c0ad46d 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -767,7 +767,7 @@ class SizeofTest(unittest.TestCase):
check(iter([]), size('lP'))
# listreverseiterator (list)
check(reversed([]), size('nP'))
- # long
+ # int
check(0, vsize(''))
check(1, vsize('') + self.longdigit)
check(-1, vsize('') + self.longdigit)
diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py
index d7b2db3725..0f9522aa3c 100644
--- a/Lib/xmlrpc/client.py
+++ b/Lib/xmlrpc/client.py
@@ -539,7 +539,7 @@ class Marshaller:
def dump_long(self, value, write):
if value > MAXINT or value < MININT:
- raise OverflowError("long int exceeds XML-RPC limits")
+ raise OverflowError("int exceeds XML-RPC limits")
write("<value><int>")
write(str(int(value)))
write("</int></value>\n")
diff --git a/Misc/NEWS b/Misc/NEWS
index 6de48123e7..be2dc9dde8 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -360,6 +360,11 @@ Tests
Documentation
-------------
+- Issue #18743: Fix references to non-existant "StringIO" module.
+
+- Issue #18783: Removed existing mentions of Python long type in docstrings,
+ error messages and comments.
+
- Issue #17701: Improving strftime documentation.
- Issue #18440: Clarify that `hash()` can truncate the value returned from an
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index ade52fd9d2..09eb653b30 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -650,7 +650,7 @@ static int ConvParam(PyObject *obj, Py_ssize_t index, struct argument *pa)
pa->value.i = PyLong_AsLong(obj);
if (pa->value.i == -1 && PyErr_Occurred()) {
PyErr_SetString(PyExc_OverflowError,
- "long int too long to convert");
+ "int too long to convert");
return -1;
}
}
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 7c7170dc77..fa231d9259 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -1401,9 +1401,9 @@ static PyObject *us_per_us = NULL; /* 1 */
static PyObject *us_per_ms = NULL; /* 1000 */
static PyObject *us_per_second = NULL; /* 1000000 */
static PyObject *us_per_minute = NULL; /* 1e6 * 60 as Python int */
-static PyObject *us_per_hour = NULL; /* 1e6 * 3600 as Python long */
-static PyObject *us_per_day = NULL; /* 1e6 * 3600 * 24 as Python long */
-static PyObject *us_per_week = NULL; /* 1e6*3600*24*7 as Python long */
+static PyObject *us_per_hour = NULL; /* 1e6 * 3600 as Python int */
+static PyObject *us_per_day = NULL; /* 1e6 * 3600 * 24 as Python int */
+static PyObject *us_per_week = NULL; /* 1e6*3600*24*7 as Python int */
static PyObject *seconds_per_day = NULL; /* 3600*24 as Python int */
/* ---------------------------------------------------------------------------
@@ -1416,7 +1416,7 @@ static PyObject *seconds_per_day = NULL; /* 3600*24 as Python int */
/* Convert a timedelta to a number of us,
* (24*3600*self.days + self.seconds)*1000000 + self.microseconds
- * as a Python int or long.
+ * as a Python int.
* Doing mixed-radix arithmetic by hand instead is excruciating in C,
* due to ubiquitous overflow possibilities.
*/
@@ -1468,7 +1468,7 @@ Done:
return result;
}
-/* Convert a number of us (as a Python int or long) to a timedelta.
+/* Convert a number of us (as a Python int) to a timedelta.
*/
static PyObject *
microseconds_to_delta_ex(PyObject *pyus, PyTypeObject *type)
@@ -3886,7 +3886,7 @@ static char time_doc[] =
PyDoc_STR("time([hour[, minute[, second[, microsecond[, tzinfo]]]]]) --> a time object\n\
\n\
All arguments are optional. tzinfo may be None, or an instance of\n\
-a tzinfo subclass. The remaining arguments may be ints or longs.\n");
+a tzinfo subclass. The remaining arguments may be ints.\n");
static PyNumberMethods time_as_number = {
0, /* nb_add */
@@ -5069,7 +5069,7 @@ static char datetime_doc[] =
PyDoc_STR("datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])\n\
\n\
The year, month and day arguments are required. tzinfo may be None, or an\n\
-instance of a tzinfo subclass. The remaining arguments may be ints or longs.\n");
+instance of a tzinfo subclass. The remaining arguments may be ints.\n");
static PyNumberMethods datetime_as_number = {
datetime_add, /* nb_add */
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index ce573cf9f9..bc3b406f32 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -387,8 +387,8 @@ static PyTypeObject Unpickler_Type;
/*************************************************************************
- A custom hashtable mapping void* to longs. This is used by the pickler for
- memoization. Using a custom hashtable rather than PyDict allows us to skip
+ A custom hashtable mapping void* to Python ints. This is used by the pickler
+ for memoization. Using a custom hashtable rather than PyDict allows us to skip
a bunch of unnecessary object creation. This makes a huge performance
difference. */
@@ -1581,8 +1581,8 @@ save_long(PicklerObject *self, PyObject *obj)
* need another byte even if there aren't any leftovers:
* the most-significant bit of the most-significant byte
* acts like a sign bit, and it's usually got a sense
- * opposite of the one we need. The exception is longs
- * of the form -(2**(8*j-1)) for j > 0. Such a long is
+ * opposite of the one we need. The exception is ints
+ * of the form -(2**(8*j-1)) for j > 0. Such an int is
* its own 256's-complement, so has the right sign bit
* even without the extra byte. That's a pain to check
* for in advance, though, so we always grab an extra
@@ -1591,7 +1591,7 @@ save_long(PicklerObject *self, PyObject *obj)
nbytes = (nbits >> 3) + 1;
if (nbytes > 0x7fffffffL) {
PyErr_SetString(PyExc_OverflowError,
- "long too large to pickle");
+ "int too large to pickle");
goto error;
}
repr = PyBytes_FromStringAndSize(NULL, (Py_ssize_t)nbytes);
@@ -1603,7 +1603,7 @@ save_long(PicklerObject *self, PyObject *obj)
1 /* little endian */ , 1 /* signed */ );
if (i < 0)
goto error;
- /* If the long is negative, this may be a byte more than
+ /* If the int is negative, this may be a byte more than
* needed. This is so iff the MSB is all redundant sign
* bits.
*/
@@ -3917,7 +3917,7 @@ load_int(UnpicklerObject *self)
if (errno || (*endptr != '\n' && *endptr != '\0')) {
/* Hm, maybe we've got something long. Let's try reading
- * it as a Python long object. */
+ * it as a Python int object. */
errno = 0;
/* XXX: Same thing about the base here. */
value = PyLong_FromString(s, NULL, 0);
diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c
index 6540ab9d4c..21a2b09f94 100644
--- a/Modules/_randommodule.c
+++ b/Modules/_randommodule.c
@@ -444,7 +444,7 @@ static PyMethodDef random_methods[] = {
{"setstate", (PyCFunction)random_setstate, METH_O,
PyDoc_STR("setstate(state) -> None. Restores generator state.")},
{"getrandbits", (PyCFunction)random_getrandbits, METH_VARARGS,
- PyDoc_STR("getrandbits(k) -> x. Generates a long int with "
+ PyDoc_STR("getrandbits(k) -> x. Generates an int with "
"k random bits.")},
{NULL, NULL} /* sentinel */
};
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 28bd647b3f..451ea241bd 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -715,6 +715,9 @@ error:
#ifdef WITH_THREAD
PyGILState_Release(threadstate);
#endif
+ /* explicit return to avoid a compilation error if WITH_THREAD
+ is not defined */
+ return;
}
static void _pysqlite_drop_unused_statement_references(pysqlite_Connection* self)
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 28486140f1..a248753766 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -1631,7 +1631,7 @@ s_pack_internal(PyStructObject *soself, PyObject *args, int offset, char* buf)
if (e->pack(res, v, e) < 0) {
if (PyLong_Check(v) && PyErr_ExceptionMatches(PyExc_OverflowError))
PyErr_SetString(StructError,
- "long too large to convert to int");
+ "int too large to convert");
return -1;
}
}
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 86ef713fae..7df3e19fc6 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -1635,7 +1635,7 @@ test_long_numbits(PyObject *self)
{-3L, 2, -1},
{4L, 3, 1},
{-4L, 3, -1},
- {0x7fffL, 15, 1}, /* one Python long digit */
+ {0x7fffL, 15, 1}, /* one Python int digit */
{-0x7fffL, 15, -1},
{0xffffL, 16, 1},
{-0xffffL, 16, -1},
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 3fa52d0403..4b3e642ff6 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -1535,8 +1535,7 @@ math_ldexp(PyObject *self, PyObject *args)
}
else {
PyErr_SetString(PyExc_TypeError,
- "Expected an int or long as second argument "
- "to ldexp.");
+ "Expected an int as second argument to ldexp.");
return NULL;
}
@@ -1598,19 +1597,19 @@ PyDoc_STRVAR(math_modf_doc,
"Return the fractional and integer parts of x. Both results carry the sign\n"
"of x and are floats.");
-/* A decent logarithm is easy to compute even for huge longs, but libm can't
+/* A decent logarithm is easy to compute even for huge ints, but libm can't
do that by itself -- loghelper can. func is log or log10, and name is
- "log" or "log10". Note that overflow of the result isn't possible: a long
+ "log" or "log10". Note that overflow of the result isn't possible: an int
can contain no more than INT_MAX * SHIFT bits, so has value certainly less
than 2**(2**64 * 2**16) == 2**2**80, and log2 of that is 2**80, which is
small enough to fit in an IEEE single. log and log10 are even smaller.
- However, intermediate overflow is possible for a long if the number of bits
- in that long is larger than PY_SSIZE_T_MAX. */
+ However, intermediate overflow is possible for an int if the number of bits
+ in that int is larger than PY_SSIZE_T_MAX. */
static PyObject*
loghelper(PyObject* arg, double (*func)(double), char *funcname)
{
- /* If it is long, do it ourselves. */
+ /* If it is int, do it ourselves. */
if (PyLong_Check(arg)) {
double x, result;
Py_ssize_t e;
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 1202d38693..3bddaa5998 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -4693,14 +4693,14 @@ socket_ntohl(PyObject *self, PyObject *arg)
y = x & 0xFFFFFFFFUL;
if (y ^ x)
return PyErr_Format(PyExc_OverflowError,
- "long int larger than 32 bits");
+ "int larger than 32 bits");
x = y;
}
#endif
}
else
return PyErr_Format(PyExc_TypeError,
- "expected int/long, %s found",
+ "expected int, %s found",
Py_TYPE(arg)->tp_name);
return PyLong_FromUnsignedLong(ntohl(x));
}
@@ -4750,14 +4750,14 @@ socket_htonl(PyObject *self, PyObject *arg)
y = x & 0xFFFFFFFFUL;
if (y ^ x)
return PyErr_Format(PyExc_OverflowError,
- "long int larger than 32 bits");
+ "int larger than 32 bits");
x = y;
}
#endif
}
else
return PyErr_Format(PyExc_TypeError,
- "expected int/long, %s found",
+ "expected int, %s found",
Py_TYPE(arg)->tp_name);
return PyLong_FromUnsignedLong(htonl((unsigned long)x));
}
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 7f1808faea..1309c5158e 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -1132,8 +1132,8 @@ PyNumber_Absolute(PyObject *o)
return type_error("bad operand type for abs(): '%.200s'", o);
}
-/* Return a Python Int or Long from the object item
- Raise TypeError if the result is not an int-or-long
+/* Return a Python int from the object item
+ Raise TypeError if the result is not an int
or if the object cannot be interpreted as an index.
*/
PyObject *
@@ -1343,8 +1343,7 @@ PyNumber_ToBase(PyObject *n, int base)
/* It should not be possible to get here, as
PyNumber_Index already has a check for the same
condition */
- PyErr_SetString(PyExc_ValueError, "PyNumber_ToBase: index not "
- "int or long");
+ PyErr_SetString(PyExc_ValueError, "PyNumber_ToBase: index not int");
Py_DECREF(index);
return res;
}
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 3a31314086..98f42a9f34 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -186,9 +186,9 @@ PyFile_WriteString(const char *s, PyObject *f)
}
/* Try to get a file-descriptor from a Python object. If the object
- is an integer or long integer, its value is returned. If not, the
+ is an integer, its value is returned. If not, the
object's fileno() method is called if it exists; the method must return
- an integer or long integer, which is returned as the file descriptor value.
+ an integer, which is returned as the file descriptor value.
-1 is returned on failure.
*/
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index b571ca8c70..5fcdf3225c 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -232,7 +232,7 @@ PyFloat_AsDouble(PyObject *op)
/* Macro and helper that convert PyObject obj to a C double and store
the value in dbl. If conversion to double raises an exception, obj is
set to NULL, and the function invoking this macro returns NULL. If
- obj is not of float, int or long type, Py_NotImplemented is incref'ed,
+ obj is not of float or int type, Py_NotImplemented is incref'ed,
stored in obj, and returned from the function invoking this macro.
*/
#define CONVERT_TO_DOUBLE(obj, dbl) \
@@ -287,7 +287,7 @@ float_repr(PyFloatObject *v)
* When mixing float with an integer type, there's no good *uniform* approach.
* Converting the double to an integer obviously doesn't work, since we
* may lose info from fractional bits. Converting the integer to a double
- * also has two failure modes: (1) a long int may trigger overflow (too
+ * also has two failure modes: (1) an int may trigger overflow (too
* large to fit in the dynamic range of a C double); (2) even a C long may have
* more bits than fit in a C double (e.g., on a 64-bit box long may have
* 63 bits of precision, but a C double probably has only 53), and then
@@ -385,7 +385,7 @@ float_richcompare(PyObject *v, PyObject *w, int op)
goto Compare;
}
/* v and w have the same number of bits before the radix
- * point. Construct two longs that have the same comparison
+ * point. Construct two ints that have the same comparison
* outcome.
*/
{
@@ -450,7 +450,7 @@ float_richcompare(PyObject *v, PyObject *w, int op)
}
} /* else if (PyLong_Check(w)) */
- else /* w isn't float, int, or long */
+ else /* w isn't float or int */
goto Unimplemented;
Compare:
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 30ffc94d41..985b1ec83c 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -68,16 +68,16 @@ maybe_small_long(PyLongObject *v)
#define maybe_small_long(val) (val)
#endif
-/* If a freshly-allocated long is already shared, it must
+/* If a freshly-allocated int is already shared, it must
be a small integer, so negating it must go to PyLong_FromLong */
#define NEGATE(x) \
do if (Py_REFCNT(x) == 1) Py_SIZE(x) = -Py_SIZE(x); \
else { PyObject* tmp=PyLong_FromLong(-MEDIUM_VALUE(x)); \
Py_DECREF(x); (x) = (PyLongObject*)tmp; } \
while(0)
-/* For long multiplication, use the O(N**2) school algorithm unless
+/* For int multiplication, use the O(N**2) school algorithm unless
* both operands contain more than KARATSUBA_CUTOFF digits (this
- * being an internal Python long digit, in base BASE).
+ * being an internal Python int digit, in base BASE).
*/
#define KARATSUBA_CUTOFF 70
#define KARATSUBA_SQUARE_CUTOFF (2 * KARATSUBA_CUTOFF)
@@ -99,7 +99,7 @@ maybe_small_long(PyLongObject *v)
if (PyErr_CheckSignals()) PyTryBlock \
} while(0)
-/* Normalize (remove leading zeros from) a long int object.
+/* Normalize (remove leading zeros from) an int object.
Doesn't attempt to free the storage--in most cases, due to the nature
of the algorithms used, this could save at most be one word anyway. */
@@ -116,7 +116,7 @@ long_normalize(register PyLongObject *v)
return v;
}
-/* Allocate a new long int object with size digits.
+/* Allocate a new int object with size digits.
Return NULL and set exception if we run out of memory. */
#define MAX_LONG_DIGITS \
@@ -168,7 +168,7 @@ _PyLong_Copy(PyLongObject *src)
return (PyObject *)result;
}
-/* Create a new long int object from a C long int */
+/* Create a new int object from a C long int */
PyObject *
PyLong_FromLong(long ival)
@@ -237,7 +237,7 @@ PyLong_FromLong(long ival)
return (PyObject *)v;
}
-/* Create a new long int object from a C unsigned long int */
+/* Create a new int object from a C unsigned long int */
PyObject *
PyLong_FromUnsignedLong(unsigned long ival)
@@ -266,7 +266,7 @@ PyLong_FromUnsignedLong(unsigned long ival)
return (PyObject *)v;
}
-/* Create a new long int object from a C double */
+/* Create a new int object from a C double */
PyObject *
PyLong_FromDouble(double dval)
@@ -320,7 +320,7 @@ PyLong_FromDouble(double dval)
#define PY_ABS_LONG_MIN (0-(unsigned long)LONG_MIN)
#define PY_ABS_SSIZE_T_MIN (0-(size_t)PY_SSIZE_T_MIN)
-/* Get a C long int from a long int object or any object that has an __int__
+/* Get a C long int from an int object or any object that has an __int__
method.
On overflow, return -1 and set *overflow to 1 or -1 depending on the sign of
@@ -417,7 +417,7 @@ PyLong_AsLongAndOverflow(PyObject *vv, int *overflow)
return res;
}
-/* Get a C long int from a long int object or any object that has an __int__
+/* Get a C long int from an int object or any object that has an __int__
method. Return -1 and set an error if overflow occurs. */
long
@@ -434,7 +434,7 @@ PyLong_AsLong(PyObject *obj)
return result;
}
-/* Get a C int from a long int object or any object that has an __int__
+/* Get a C int from an int object or any object that has an __int__
method. Return -1 and set an error if overflow occurs. */
int
@@ -452,7 +452,7 @@ _PyLong_AsInt(PyObject *obj)
return (int)result;
}
-/* Get a Py_ssize_t from a long int object.
+/* Get a Py_ssize_t from an int object.
Returns -1 and sets an error condition if overflow occurs. */
Py_ssize_t
@@ -507,7 +507,7 @@ PyLong_AsSsize_t(PyObject *vv) {
return -1;
}
-/* Get a C unsigned long int from a long int object.
+/* Get a C unsigned long int from an int object.
Returns -1 and sets an error condition if overflow occurs. */
unsigned long
@@ -551,7 +551,7 @@ PyLong_AsUnsignedLong(PyObject *vv)
return x;
}
-/* Get a C size_t from a long int object. Returns (size_t)-1 and sets
+/* Get a C size_t from an int object. Returns (size_t)-1 and sets
an error condition if overflow occurs. */
size_t
@@ -594,7 +594,7 @@ PyLong_AsSize_t(PyObject *vv)
return x;
}
-/* Get a C unsigned long int from a long int object, ignoring the high bits.
+/* Get a C unsigned long int from an int object, ignoring the high bits.
Returns -1 and sets an error condition if an error occurs. */
static unsigned long
@@ -712,7 +712,7 @@ _PyLong_FromByteArray(const unsigned char* bytes, size_t n,
int incr; /* direction to move pstartbyte */
const unsigned char* pendbyte; /* MSB of bytes */
size_t numsignificantbytes; /* number of bytes that matter */
- Py_ssize_t ndigits; /* number of Python long digits */
+ Py_ssize_t ndigits; /* number of Python int digits */
PyLongObject* v; /* result */
Py_ssize_t idigit = 0; /* next free index in v->ob_digit */
@@ -756,8 +756,8 @@ _PyLong_FromByteArray(const unsigned char* bytes, size_t n,
++numsignificantbytes;
}
- /* How many Python long digits do we need? We have
- 8*numsignificantbytes bits, and each Python long digit has
+ /* How many Python int digits do we need? We have
+ 8*numsignificantbytes bits, and each Python int digit has
PyLong_SHIFT bits, so it's the ceiling of the quotient. */
/* catch overflow before it happens */
if (numsignificantbytes > (PY_SSIZE_T_MAX - PyLong_SHIFT) / 8) {
@@ -857,7 +857,7 @@ _PyLong_AsByteArray(PyLongObject* v,
/* Copy over all the Python digits.
It's crucial that every Python digit except for the MSD contribute
- exactly PyLong_SHIFT bits to the total, so first assert that the long is
+ exactly PyLong_SHIFT bits to the total, so first assert that the int is
normalized. */
assert(ndigits == 0 || v->ob_digit[ndigits - 1] != 0);
j = 0;
@@ -912,7 +912,7 @@ _PyLong_AsByteArray(PyLongObject* v,
++j;
if (do_twos_comp) {
/* Fill leading bits of the byte with sign bits
- (appropriately pretending that the long had an
+ (appropriately pretending that the int had an
infinite supply of sign bits). */
accum |= (~(twodigits)0) << accumbits;
}
@@ -948,7 +948,7 @@ _PyLong_AsByteArray(PyLongObject* v,
}
-/* Create a new long int object from a C pointer */
+/* Create a new int object from a C pointer */
PyObject *
PyLong_FromVoidPtr(void *p)
@@ -974,7 +974,7 @@ PyLong_FromVoidPtr(void *p)
}
-/* Get a C pointer from a long int object. */
+/* Get a C pointer from an int object. */
void *
PyLong_AsVoidPtr(PyObject *vv)
@@ -1017,7 +1017,7 @@ PyLong_AsVoidPtr(PyObject *vv)
#define IS_LITTLE_ENDIAN (int)*(unsigned char*)&one
#define PY_ABS_LLONG_MIN (0-(unsigned PY_LONG_LONG)PY_LLONG_MIN)
-/* Create a new long int object from a C PY_LONG_LONG int. */
+/* Create a new int object from a C PY_LONG_LONG int. */
PyObject *
PyLong_FromLongLong(PY_LONG_LONG ival)
@@ -1061,7 +1061,7 @@ PyLong_FromLongLong(PY_LONG_LONG ival)
return (PyObject *)v;
}
-/* Create a new long int object from a C unsigned PY_LONG_LONG int. */
+/* Create a new int object from a C unsigned PY_LONG_LONG int. */
PyObject *
PyLong_FromUnsignedLongLong(unsigned PY_LONG_LONG ival)
@@ -1090,7 +1090,7 @@ PyLong_FromUnsignedLongLong(unsigned PY_LONG_LONG ival)
return (PyObject *)v;
}
-/* Create a new long int object from a C Py_ssize_t. */
+/* Create a new int object from a C Py_ssize_t. */
PyObject *
PyLong_FromSsize_t(Py_ssize_t ival)
@@ -1130,7 +1130,7 @@ PyLong_FromSsize_t(Py_ssize_t ival)
return (PyObject *)v;
}
-/* Create a new long int object from a C size_t. */
+/* Create a new int object from a C size_t. */
PyObject *
PyLong_FromSize_t(size_t ival)
@@ -1159,7 +1159,7 @@ PyLong_FromSize_t(size_t ival)
return (PyObject *)v;
}
-/* Get a C long long int from a long int object or any object that has an
+/* Get a C long long int from an int object or any object that has an
__int__ method. Return -1 and set an error if overflow occurs. */
PY_LONG_LONG
@@ -1211,7 +1211,7 @@ PyLong_AsLongLong(PyObject *vv)
return bytes;
}
-/* Get a C unsigned PY_LONG_LONG int from a long int object.
+/* Get a C unsigned PY_LONG_LONG int from an int object.
Return -1 and set an error if overflow occurs. */
unsigned PY_LONG_LONG
@@ -1247,7 +1247,7 @@ PyLong_AsUnsignedLongLong(PyObject *vv)
return bytes;
}
-/* Get a C unsigned long int from a long int object, ignoring the high bits.
+/* Get a C unsigned long int from an int object, ignoring the high bits.
Returns -1 and sets an error condition if an error occurs. */
static unsigned PY_LONG_LONG
@@ -1316,7 +1316,7 @@ PyLong_AsUnsignedLongLongMask(register PyObject *op)
}
#undef IS_LITTLE_ENDIAN
-/* Get a C long long int from a long int object or any object that has an
+/* Get a C long long int from an int object or any object that has an
__int__ method.
On overflow, return -1 and set *overflow to 1 or -1 depending on the sign of
@@ -1533,7 +1533,7 @@ v_rshift(digit *z, digit *a, Py_ssize_t m, int d)
/* Divide long pin, w/ size digits, by non-zero digit n, storing quotient
in pout, and returning the remainder. pin and pout point at the LSD.
It's OK for pin == pout on entry, which saves oodles of mallocs/frees in
- _PyLong_Format, but that should be done with great care since longs are
+ _PyLong_Format, but that should be done with great care since ints are
immutable. */
static digit
@@ -1553,7 +1553,7 @@ inplace_divrem1(digit *pout, digit *pin, Py_ssize_t size, digit n)
return (digit)rem;
}
-/* Divide a long integer by a digit, returning both the quotient
+/* Divide an integer by a digit, returning both the quotient
(as function result) and the remainder (through *prem).
The sign of a is ignored; n should not be zero. */
@@ -1571,7 +1571,7 @@ divrem1(PyLongObject *a, digit n, digit *prem)
return long_normalize(z);
}
-/* Convert a long integer to a base 10 string. Returns a new non-shared
+/* Convert an integer to a base 10 string. Returns a new non-shared
string. (Return value is non-shared so that callers can modify the
returned value if necessary.) */
@@ -1740,7 +1740,7 @@ long_to_decimal_string(PyObject *aa)
return v;
}
-/* Convert a long int object to a string, using a given conversion base,
+/* Convert an int object to a string, using a given conversion base,
which should be one of 2, 8 or 16. Return a string object.
If base is 2, 8 or 16, add the proper prefix '0b', '0o' or '0x'
if alternate is nonzero. */
@@ -1941,7 +1941,7 @@ unsigned char _PyLong_DigitValue[256] = {
/* *str points to the first digit in a string of base `base` digits. base
* is a power of 2 (2, 4, 8, 16, or 32). *str is set to point to the first
- * non-digit (which may be *str!). A normalized long is returned.
+ * non-digit (which may be *str!). A normalized int is returned.
* The point to this routine is that it takes time linear in the number of
* string characters.
*/
@@ -1976,7 +1976,7 @@ long_from_binary_base(char **str, int base)
z = _PyLong_New(n);
if (z == NULL)
return NULL;
- /* Read string from right, and fill in long from left; i.e.,
+ /* Read string from right, and fill in int from left; i.e.,
* from least to most significant in both.
*/
accum = 0;
@@ -2005,7 +2005,7 @@ long_from_binary_base(char **str, int base)
return long_normalize(z);
}
-/* Parses a long from a bytestring. Leading and trailing whitespace will be
+/* Parses an int from a bytestring. Leading and trailing whitespace will be
* ignored.
*
* If successful, a PyLong object will be returned and 'pend' will be pointing
@@ -2075,7 +2075,7 @@ case number of Python digits needed to hold it is the smallest integer n s.t.
n >= log(B**N)/log(BASE) = N * log(B)/log(BASE)
The static array log_base_BASE[base] == log(base)/log(BASE) so we can compute
-this quickly. A Python long with that much space is reserved near the start,
+this quickly. A Python int with that much space is reserved near the start,
and the result is computed into it.
The input string is actually treated as being in base base**i (i.e., i digits
@@ -2140,7 +2140,7 @@ is very close to an integer. If we were working with IEEE single-precision,
rounding errors could kill us. Finding worst cases in IEEE double-precision
requires better-than-double-precision log() functions, and Tim didn't bother.
Instead the code checks to see whether the allocated space is enough as each
-new Python digit is added, and copies the whole thing to a larger long if not.
+new Python digit is added, and copies the whole thing to a larger int if not.
This should happen extremely rarely, and in fact I don't have a test case
that triggers it(!). Instead the code was tested by artificially allocating
just 1 digit at the start, so that the copying code was exercised for every
@@ -2181,7 +2181,7 @@ digit beyond the first.
while (_PyLong_DigitValue[Py_CHARMASK(*scan)] < base)
++scan;
- /* Create a long object that can contain the largest possible
+ /* Create an int object that can contain the largest possible
* integer with this base and length. Note that there's no
* need to initialize z->ob_digit -- no slot is read up before
* being stored into.
@@ -2374,7 +2374,7 @@ static PyLongObject *x_divrem
(PyLongObject *, PyLongObject *, PyLongObject **);
static PyObject *long_long(PyObject *v);
-/* Long division with remainder, top-level routine */
+/* Int division with remainder, top-level routine */
static int
long_divrem(PyLongObject *a, PyLongObject *b,
@@ -2427,7 +2427,7 @@ long_divrem(PyLongObject *a, PyLongObject *b,
return 0;
}
-/* Unsigned long division with remainder -- the algorithm. The arguments v1
+/* Unsigned int division with remainder -- the algorithm. The arguments v1
and w1 should satisfy 2 <= ABS(Py_SIZE(w1)) <= ABS(Py_SIZE(v1)). */
static PyLongObject *
@@ -2678,7 +2678,7 @@ _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e)
return -1.0;
}
-/* Get a C double from a long int object. Rounds to the nearest double,
+/* Get a C double from an int object. Rounds to the nearest double,
using the round-half-to-even rule in the case of a tie. */
double
@@ -2834,7 +2834,7 @@ long_hash(PyLongObject *v)
}
-/* Add the absolute values of two long integers. */
+/* Add the absolute values of two integers. */
static PyLongObject *
x_add(PyLongObject *a, PyLongObject *b)
@@ -3042,7 +3042,7 @@ x_mul(PyLongObject *a, PyLongObject *b)
assert((carry >> PyLong_SHIFT) == 0);
}
}
- else { /* a is not the same as b -- gradeschool long mult */
+ else { /* a is not the same as b -- gradeschool int mult */
for (i = 0; i < size_a; ++i) {
twodigits carry = 0;
twodigits f = a->ob_digit[i];
@@ -3070,7 +3070,7 @@ x_mul(PyLongObject *a, PyLongObject *b)
}
/* A helper for Karatsuba multiplication (k_mul).
- Takes a long "n" and an integer "size" representing the place to
+ Takes an int "n" and an integer "size" representing the place to
split, and sets low and high such that abs(n) == (high << size) + low,
viewing the shift as being by digits. The sign bit is ignored, and
the return values are >= 0.
@@ -4368,10 +4368,10 @@ long_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
}
}
-/* Wimpy, slow approach to tp_new calls for subtypes of long:
- first create a regular long from whatever arguments we got,
+/* Wimpy, slow approach to tp_new calls for subtypes of int:
+ first create a regular int from whatever arguments we got,
then allocate a subtype instance and initialize it from
- the regular long. The regular long is then thrown away.
+ the regular int. The regular int is then thrown away.
*/
static PyObject *
long_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
@@ -4822,7 +4822,7 @@ long_from_bytes(PyTypeObject *type, PyObject *args, PyObject *kwds)
Py_DECREF(bytes);
/* If from_bytes() was used on subclass, allocate new subclass
- * instance, initialize it with decoded long value and return it.
+ * instance, initialize it with decoded int value and return it.
*/
if (type != &PyLong_Type && PyType_IsSubtype(type, &PyLong_Type)) {
PyLongObject *newobj;
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
index 214b4556b5..343881ae31 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -933,7 +933,7 @@ PyTypeObject PyRange_Type = {
/*********************** range Iterator **************************/
/* There are 2 types of iterators, one for C longs, the other for
- Python longs (ie, PyObjects). This should make iteration fast
+ Python ints (ie, PyObjects). This should make iteration fast
in the normal case, but possible for any numeric value.
*/
diff --git a/PC/pyconfig.h b/PC/pyconfig.h
index d6de5f013e..f320ccf588 100644
--- a/PC/pyconfig.h
+++ b/PC/pyconfig.h
@@ -398,7 +398,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
#endif
/* define signed and unsigned exact-width 32-bit and 64-bit types, used in the
- implementation of Python long integers. */
+ implementation of Python integers. */
#ifndef PY_UINT32_T
#if SIZEOF_INT == 4
#define HAVE_UINT32_T 1
diff --git a/PC/winreg.c b/PC/winreg.c
index 38a9e696eb..3b9693cc6a 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -253,7 +253,7 @@ PyDoc_STRVAR(QueryInfoKey_doc,
"The result is a tuple of 3 items:"
"An integer that identifies the number of sub keys this key has.\n"
"An integer that identifies the number of values this key has.\n"
-"A long integer that identifies when the key was last modified (if available)\n"
+"An integer that identifies when the key was last modified (if available)\n"
" as 100's of nanoseconds since Jan 1, 1600.");
PyDoc_STRVAR(QueryValue_doc,
@@ -405,8 +405,7 @@ PyDoc_STRVAR(PyHKEY_Detach_doc,
"After calling this function, the handle is effectively invalidated,\n"
"but the handle is not closed. You would call this function when you\n"
"need the underlying win32 handle to exist beyond the lifetime of the\n"
-"handle object.\n"
-"On 64 bit windows, the result of this function is a long integer");
+"handle object.");
/************************************************************************
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index b07ee8ec32..dffdf46a62 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -1512,7 +1512,7 @@ PyDoc_STRVAR(pow_doc,
"pow(x, y[, z]) -> number\n\
\n\
With two arguments, equivalent to x**y. With three arguments,\n\
-equivalent to (x**y) % z, but may be more efficient (e.g. for longs).");
+equivalent to (x**y) % z, but may be more efficient (e.g. for ints).");
diff --git a/Python/compile.c b/Python/compile.c
index dd4262c170..6d66255c98 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1013,7 +1013,7 @@ compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o)
Py_ssize_t arg;
double d;
- /* necessary to make sure types aren't coerced (e.g., int and long) */
+ /* necessary to make sure types aren't coerced (e.g., float and complex) */
/* _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms */
if (PyFloat_Check(o)) {
d = PyFloat_AS_DOUBLE(o);
diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c
index 2fe446a1b0..a6516dceeb 100644
--- a/Python/formatter_unicode.c
+++ b/Python/formatter_unicode.c
@@ -1439,8 +1439,7 @@ _PyLong_FormatAdvancedWriter(_PyUnicodeWriter *writer,
case 'x':
case 'X':
case 'n':
- /* no type conversion needed, already an int (or long). do
- the formatting */
+ /* no type conversion needed, already an int. do the formatting */
result = format_long_internal(obj, &format, writer);
break;
diff --git a/Python/marshal.c b/Python/marshal.c
index a0e527fc83..cc17329913 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -146,7 +146,7 @@ w_pstring(const char *s, Py_ssize_t n, WFILE *p)
w_string(s, n, p);
}
-/* We assume that Python longs are stored internally in base some power of
+/* We assume that Python ints are stored internally in base some power of
2**15; for the sake of portability we'll always read and write them in base
exactly 2**15. */
@@ -432,7 +432,7 @@ w_object(PyObject *v, WFILE *p)
p->depth--;
}
-/* version currently has no effect for writing longs. */
+/* version currently has no effect for writing ints. */
void
PyMarshal_WriteLongToFile(long x, FILE *fp, int version)
{
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
index 9f5e8b4e2c..a85f50595c 100644
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -121,7 +121,7 @@ class StringTruncated(RuntimeError):
pass
class TruncatedStringIO(object):
- '''Similar to cStringIO, but can truncate the output by raising a
+ '''Similar to io.StringIO, but can truncate the output by raising a
StringTruncated exception'''
def __init__(self, maxlen=None):
self._val = ''