Issue #26778: Fixed "a/an/and" typos in code comment and documentation.
diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst
index 50b83e9..1f0bd17 100644
--- a/Doc/c-api/object.rst
+++ b/Doc/c-api/object.rst
@@ -157,7 +157,7 @@
 
    .. index:: builtin: bytes
 
-   Compute a bytes representation of object *o*.  In 2.x, this is just a alias
+   Compute a bytes representation of object *o*.  In 2.x, this is just an alias
    for :c:func:`PyObject_Str`.
 
 
diff --git a/Doc/c-api/set.rst b/Doc/c-api/set.rst
index 258530b..f6ebcf3 100644
--- a/Doc/c-api/set.rst
+++ b/Doc/c-api/set.rst
@@ -140,7 +140,7 @@
    Add *key* to a :class:`set` instance.  Does not apply to :class:`frozenset`
    instances.  Return 0 on success or -1 on failure. Raise a :exc:`TypeError` if
    the *key* is unhashable. Raise a :exc:`MemoryError` if there is no room to grow.
-   Raise a :exc:`SystemError` if *set* is an not an instance of :class:`set` or its
+   Raise a :exc:`SystemError` if *set* is not an instance of :class:`set` or its
    subtype.
 
    .. versionchanged:: 2.6
@@ -158,7 +158,7 @@
    error is encountered.  Does not raise :exc:`KeyError` for missing keys.  Raise a
    :exc:`TypeError` if the *key* is unhashable.  Unlike the Python :meth:`~set.discard`
    method, this function does not automatically convert unhashable sets into
-   temporary frozensets. Raise :exc:`PyExc_SystemError` if *set* is an not an
+   temporary frozensets. Raise :exc:`PyExc_SystemError` if *set* is not an
    instance of :class:`set` or its subtype.
 
 
@@ -166,7 +166,7 @@
 
    Return a new reference to an arbitrary object in the *set*, and removes the
    object from the *set*.  Return *NULL* on failure.  Raise :exc:`KeyError` if the
-   set is empty. Raise a :exc:`SystemError` if *set* is an not an instance of
+   set is empty. Raise a :exc:`SystemError` if *set* is not an instance of
    :class:`set` or its subtype.
 
 
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index 3262354..85800c5 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -260,7 +260,7 @@
    | :attr:`%%`        | *n/a*               | The literal % character.       |
    +-------------------+---------------------+--------------------------------+
    | :attr:`%c`        | int                 | A single character,            |
-   |                   |                     | represented as an C int.       |
+   |                   |                     | represented as a C int.        |
    +-------------------+---------------------+--------------------------------+
    | :attr:`%d`        | int                 | Exactly equivalent to          |
    |                   |                     | ``printf("%d")``.              |
diff --git a/Doc/distutils/apiref.rst b/Doc/distutils/apiref.rst
index 96a486b..d33eab6 100644
--- a/Doc/distutils/apiref.rst
+++ b/Doc/distutils/apiref.rst
@@ -832,7 +832,7 @@
 .. module:: distutils.bcppcompiler
 
 
-This module provides :class:`BorlandCCompiler`, an subclass of the abstract
+This module provides :class:`BorlandCCompiler`, a subclass of the abstract
 :class:`CCompiler` class for the Borland C++ compiler.
 
 
diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst
index 42e84d3..3cac993 100644
--- a/Doc/howto/urllib2.rst
+++ b/Doc/howto/urllib2.rst
@@ -6,7 +6,7 @@
 
 .. note::
 
-    There is an French translation of an earlier revision of this
+    There is a French translation of an earlier revision of this
     HOWTO, available at `urllib2 - Le Manuel manquant
     <http://www.voidspace.org.uk/python/articles/urllib2_francais.shtml>`_.
 
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
index e58d954..cbf0e35 100644
--- a/Doc/library/ctypes.rst
+++ b/Doc/library/ctypes.rst
@@ -657,7 +657,7 @@
 
    TenPointsArrayType = POINT * 10
 
-Here is an example of an somewhat artificial data type, a structure containing 4
+Here is an example of a somewhat artificial data type, a structure containing 4
 POINTs among other stuff::
 
    >>> from ctypes import *
@@ -1576,7 +1576,7 @@
       tuple, this method allows adapting the actual argument to an object that
       the foreign function accepts.  For example, a :class:`c_char_p` item in
       the :attr:`argtypes` tuple will convert a unicode string passed as
-      argument into an byte string using ctypes conversion rules.
+      argument into a byte string using ctypes conversion rules.
 
       New: It is now possible to put items in argtypes which are not ctypes
       types, but each item must have a :meth:`from_param` method which returns a
@@ -1964,7 +1964,7 @@
 .. function:: POINTER(type)
 
    This factory function creates and returns a new ctypes pointer type. Pointer
-   types are cached an reused internally, so calling this function repeatedly is
+   types are cached and reused internally, so calling this function repeatedly is
    cheap. *type* must be a ctypes type.
 
 
diff --git a/Doc/library/fl.rst b/Doc/library/fl.rst
index c689372..b755134 100644
--- a/Doc/library/fl.rst
+++ b/Doc/library/fl.rst
@@ -310,7 +310,7 @@
 
 .. method:: form.add_input(type, x, y, w, h, name)
 
-   Add a input object to the form.  ---  Methods: :meth:`set_input`,
+   Add an input object to the form.  ---  Methods: :meth:`set_input`,
    :meth:`get_input`, :meth:`set_input_color`, :meth:`set_input_return`.
 
 
diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst
index 4384d56..df08fe8 100644
--- a/Doc/library/idle.rst
+++ b/Doc/library/idle.rst
@@ -128,7 +128,7 @@
    Search for the currently selected string, if there is one.
 
 Find in Files...
-   Open a file search dialog.  Put results in an new output window.
+   Open a file search dialog.  Put results in a new output window.
 
 Replace...
    Open a search-and-replace dialog.
diff --git a/Doc/library/marshal.rst b/Doc/library/marshal.rst
index f4dfc1f..0698834 100644
--- a/Doc/library/marshal.rst
+++ b/Doc/library/marshal.rst
@@ -66,7 +66,7 @@
 .. function:: dump(value, file[, version])
 
    Write the value on the open file.  The value must be a supported type.  The
-   file must be a open file object such as ``sys.stdout`` or returned by
+   file must be an open file object such as ``sys.stdout`` or returned by
    :func:`open` or :func:`os.popen`.  It may not be a wrapper such as
    TemporaryFile on Windows. It must be opened in binary mode (``'wb'``
    or ``'w+b'``).
diff --git a/Doc/library/pyexpat.rst b/Doc/library/pyexpat.rst
index 0c8e7fc..f0b6bc3 100644
--- a/Doc/library/pyexpat.rst
+++ b/Doc/library/pyexpat.rst
@@ -788,7 +788,7 @@
 .. data:: XML_ERROR_UNDEFINED_ENTITY
    :noindex:
 
-   A reference was made to a entity which was not defined.
+   A reference was made to an entity which was not defined.
 
 
 .. data:: XML_ERROR_UNKNOWN_ENCODING
diff --git a/Doc/library/restricted.rst b/Doc/library/restricted.rst
index a40d1e9..80f6344 100644
--- a/Doc/library/restricted.rst
+++ b/Doc/library/restricted.rst
@@ -34,7 +34,7 @@
 *mode* parameter is ``'w'``.  It might also perform a :c:func:`chroot`\ -like
 operation on the *filename* parameter, such that root is always relative to some
 safe "sandbox" area of the filesystem.  In this case, the untrusted code would
-still see an built-in :func:`open` function in its environment, with the same
+still see a built-in :func:`open` function in its environment, with the same
 calling interface.  The semantics would be identical too, with :exc:`IOError`\ s
 being raised when the supervisor determined that an unallowable parameter is
 being used.
diff --git a/Doc/library/sgmllib.rst b/Doc/library/sgmllib.rst
index 84911fe..bffd535 100644
--- a/Doc/library/sgmllib.rst
+++ b/Doc/library/sgmllib.rst
@@ -162,7 +162,7 @@
 .. method:: SGMLParser.handle_entityref(ref)
 
    This method is called to process a general entity reference of the form
-   ``&ref;`` where *ref* is an general entity reference.  It converts *ref* by
+   ``&ref;`` where *ref* is a general entity reference.  It converts *ref* by
    passing it to :meth:`convert_entityref`.  If a translation is returned, it calls
    the method :meth:`handle_data` with the translation; otherwise, it calls the
    method ``unknown_entityref(ref)``. The default :attr:`entitydefs` defines
diff --git a/Doc/library/sunaudio.rst b/Doc/library/sunaudio.rst
index 187204e..f09a4d6 100644
--- a/Doc/library/sunaudio.rst
+++ b/Doc/library/sunaudio.rst
@@ -123,7 +123,7 @@
 .. method:: audio device.setinfo(status)
 
    This method sets the audio device status parameters. The *status* parameter is
-   an device status object as returned by :func:`getinfo` and possibly modified by
+   a device status object as returned by :func:`getinfo` and possibly modified by
    the program.
 
 
diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst
index e3d006e..ba4b3e0 100644
--- a/Doc/library/tarfile.rst
+++ b/Doc/library/tarfile.rst
@@ -110,10 +110,10 @@
    +-------------+--------------------------------------------+
    | ``'w|'``    | Open an uncompressed *stream* for writing. |
    +-------------+--------------------------------------------+
-   | ``'w|gz'``  | Open an gzip compressed *stream* for       |
+   | ``'w|gz'``  | Open a gzip compressed *stream* for        |
    |             | writing.                                   |
    +-------------+--------------------------------------------+
-   | ``'w|bz2'`` | Open an bzip2 compressed *stream* for      |
+   | ``'w|bz2'`` | Open a bzip2 compressed *stream* for       |
    |             | writing.                                   |
    +-------------+--------------------------------------------+
 
diff --git a/Doc/library/tix.rst b/Doc/library/tix.rst
index a2f31a0..8626cd8 100644
--- a/Doc/library/tix.rst
+++ b/Doc/library/tix.rst
@@ -276,7 +276,7 @@
 
    The `ExFileSelectBox
    <http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixExFileSelectBox.htm>`_
-   widget is usually embedded in a tixExFileSelectDialog widget. It provides an
+   widget is usually embedded in a tixExFileSelectDialog widget. It provides a
    convenient method for the user to select files. The style of the
    :class:`ExFileSelectBox` widget is very similar to the standard file dialog on
    MS Windows 3.1.
diff --git a/Doc/library/urllib.rst b/Doc/library/urllib.rst
index 927696a..91deb39 100644
--- a/Doc/library/urllib.rst
+++ b/Doc/library/urllib.rst
@@ -280,7 +280,7 @@
 
 .. function:: url2pathname(path)
 
-   Convert the path component *path* from an percent-encoded URL to the local syntax for a
+   Convert the path component *path* from a percent-encoded URL to the local syntax for a
    path.  This does not accept a complete URL.  This function uses :func:`unquote`
    to decode *path*.
 
diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst
index 48faa9c..0e5891a 100644
--- a/Doc/tutorial/datastructures.rst
+++ b/Doc/tutorial/datastructures.rst
@@ -452,7 +452,7 @@
 
 Though tuples may seem similar to lists, they are often used in different
 situations and for different purposes.
-Tuples are :term:`immutable`, and usually contain an heterogeneous sequence of
+Tuples are :term:`immutable`, and usually contain a heterogeneous sequence of
 elements that are accessed via unpacking (see later in this section) or indexing
 (or even by attribute in the case of :func:`namedtuples <collections.namedtuple>`).
 Lists are :term:`mutable`, and their elements are usually homogeneous and are
diff --git a/Doc/tutorial/introduction.rst b/Doc/tutorial/introduction.rst
index 40c0201..a4fb70c 100644
--- a/Doc/tutorial/introduction.rst
+++ b/Doc/tutorial/introduction.rst
@@ -307,7 +307,7 @@
 indices, if both are within bounds.  For example, the length of ``word[1:3]`` is
 2.
 
-Attempting to use a index that is too large will result in an error::
+Attempting to use an index that is too large will result in an error::
 
    >>> word[42]  # the word only has 6 characters
    Traceback (most recent call last):
diff --git a/Doc/whatsnew/2.2.rst b/Doc/whatsnew/2.2.rst
index 421846d..212ed04 100644
--- a/Doc/whatsnew/2.2.rst
+++ b/Doc/whatsnew/2.2.rst
@@ -720,7 +720,7 @@
 
 (The controversy is over whether this is *really* a design flaw, and whether
 it's worth breaking existing code to fix this.  It's caused endless discussions
-on python-dev, and in July 2001 erupted into an storm of acidly sarcastic
+on python-dev, and in July 2001 erupted into a storm of acidly sarcastic
 postings on :newsgroup:`comp.lang.python`. I won't argue for either side here
 and will stick to describing what's  implemented in 2.2.  Read :pep:`238` for a
 summary of arguments and counter-arguments.)
diff --git a/Doc/whatsnew/2.3.rst b/Doc/whatsnew/2.3.rst
index 5db3e24..f9c4547 100644
--- a/Doc/whatsnew/2.3.rst
+++ b/Doc/whatsnew/2.3.rst
@@ -411,7 +411,7 @@
 
 A new built-in function, :func:`enumerate`, will make certain loops a bit
 clearer.  ``enumerate(thing)``, where *thing* is either an iterator or a
-sequence, returns a iterator that will return ``(0, thing[0])``, ``(1,
+sequence, returns an iterator that will return ``(0, thing[0])``, ``(1,
 thing[1])``, ``(2, thing[2])``, and so forth.
 
 A common idiom to change every element of a list looks like this::