Issue #26778: Fixed "a/an/and" typos in code comment and documentation.
diff --git a/Lib/_pydecimal.py b/Lib/_pydecimal.py
index 05ba4ee..6b13d44 100644
--- a/Lib/_pydecimal.py
+++ b/Lib/_pydecimal.py
@@ -252,7 +252,7 @@
 class ConversionSyntax(InvalidOperation):
     """Trying to convert badly formed string.
 
-    This occurs and signals invalid-operation if an string is being
+    This occurs and signals invalid-operation if a string is being
     converted to a number and it does not conform to the numeric string
     syntax.  The result is [0,qNaN].
     """
diff --git a/Lib/_pyio.py b/Lib/_pyio.py
index a467ddd..313fadf 100644
--- a/Lib/_pyio.py
+++ b/Lib/_pyio.py
@@ -439,7 +439,7 @@
         return self.__closed
 
     def _checkClosed(self, msg=None):
-        """Internal: raise an ValueError if file is closed
+        """Internal: raise a ValueError if file is closed
         """
         if self.closed:
             raise ValueError("I/O operation on closed file."
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py
index 7b1eef2..7b5a084 100644
--- a/Lib/asyncio/selector_events.py
+++ b/Lib/asyncio/selector_events.py
@@ -387,7 +387,7 @@
 
         The address must be already resolved to avoid the trap of hanging the
         entire event loop when the address requires doing a DNS lookup. For
-        example, it must be an IP address, not an hostname, for AF_INET and
+        example, it must be an IP address, not a hostname, for AF_INET and
         AF_INET6 address families. Use getaddrinfo() to resolve the hostname
         asynchronously.
 
diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py
index f264191..a7ce30e 100644
--- a/Lib/email/_header_value_parser.py
+++ b/Lib/email/_header_value_parser.py
@@ -1522,7 +1522,7 @@
     This is not the RFC ctext, since we are handling nested comments in comment
     and unquoting quoted-pairs here.  We allow anything except the '()'
     characters, but if we find any ASCII other than the RFC defined printable
-    ASCII an NonPrintableDefect is added to the token's defects list.  Since
+    ASCII, a NonPrintableDefect is added to the token's defects list.  Since
     quoted pairs are converted to their unquoted values, what is returned is
     a 'ptext' token.  In this case it is a WhiteSpaceTerminal, so it's value
     is ' '.
@@ -1537,7 +1537,7 @@
     """qcontent = qtext / quoted-pair
 
     We allow anything except the DQUOTE character, but if we find any ASCII
-    other than the RFC defined printable ASCII an NonPrintableDefect is
+    other than the RFC defined printable ASCII, a NonPrintableDefect is
     added to the token's defects list.  Any quoted pairs are converted to their
     unquoted values, so what is returned is a 'ptext' token.  In this case it
     is a ValueTerminal.
@@ -1882,7 +1882,7 @@
         obs-dtext = obs-NO-WS-CTL / quoted-pair
 
     We allow anything except the excluded characters, but if we find any
-    ASCII other than the RFC defined printable ASCII an NonPrintableDefect is
+    ASCII other than the RFC defined printable ASCII, a NonPrintableDefect is
     added to the token's defects list.  Quoted pairs are converted to their
     unquoted values, so what is returned is a ptext token, in this case a
     ValueTerminal.  If there were quoted-printables, an ObsoleteHeaderDefect is
diff --git a/Lib/email/headerregistry.py b/Lib/email/headerregistry.py
index 4e142ee..0fc2231 100644
--- a/Lib/email/headerregistry.py
+++ b/Lib/email/headerregistry.py
@@ -109,7 +109,7 @@
     def __init__(self, display_name=None, addresses=None):
         """Create an object representing an address group.
 
-        An address group consists of a display_name followed by colon and an
+        An address group consists of a display_name followed by colon and a
         list of addresses (see Address) terminated by a semi-colon.  The Group
         is created by specifying a display_name and a possibly empty list of
         Address objects.  A Group can also be used to represent a single
diff --git a/Lib/idlelib/AutoComplete.py b/Lib/idlelib/AutoComplete.py
index b20512d..b9ec539 100644
--- a/Lib/idlelib/AutoComplete.py
+++ b/Lib/idlelib/AutoComplete.py
@@ -64,7 +64,7 @@
 
     def try_open_completions_event(self, event):
         """Happens when it would be nice to open a completion list, but not
-        really necessary, for example after an dot, so function
+        really necessary, for example after a dot, so function
         calls won't be made.
         """
         lastchar = self.text.get("insert-1c")
diff --git a/Lib/idlelib/Debugger.py b/Lib/idlelib/Debugger.py
index 250422e..d5e217d 100644
--- a/Lib/idlelib/Debugger.py
+++ b/Lib/idlelib/Debugger.py
@@ -372,7 +372,7 @@
     def __init__(self, master, flist, gui):
         if macosxSupport.isAquaTk():
             # At least on with the stock AquaTk version on OSX 10.4 you'll
-            # get an shaking GUI that eventually kills IDLE if the width
+            # get a shaking GUI that eventually kills IDLE if the width
             # argument is specified.
             ScrolledList.__init__(self, master)
         else:
diff --git a/Lib/idlelib/WidgetRedirector.py b/Lib/idlelib/WidgetRedirector.py
index 67d7f61..b66be9e 100644
--- a/Lib/idlelib/WidgetRedirector.py
+++ b/Lib/idlelib/WidgetRedirector.py
@@ -68,7 +68,7 @@
         '''Return OriginalCommand(operation) after registering function.
 
         Registration adds an operation: function pair to ._operations.
-        It also adds an widget function attribute that masks the tkinter
+        It also adds a widget function attribute that masks the tkinter
         class instance method.  Method masking operates independently
         from command dispatch.
 
diff --git a/Lib/idlelib/configDialog.py b/Lib/idlelib/configDialog.py
index 9b16459..f00db39 100644
--- a/Lib/idlelib/configDialog.py
+++ b/Lib/idlelib/configDialog.py
@@ -1196,7 +1196,7 @@
 
         All values are treated as text, and it is up to the user to supply
         reasonable values. The only exception to this are the 'enable*' options,
-        which are boolean, and can be toggled with an True/False button.
+        which are boolean, and can be toggled with a True/False button.
         """
         parent = self.parent
         frame = self.tabPages.pages['Extensions'].frame
diff --git a/Lib/lib2to3/fixer_base.py b/Lib/lib2to3/fixer_base.py
index b176056..1ce62fe 100644
--- a/Lib/lib2to3/fixer_base.py
+++ b/Lib/lib2to3/fixer_base.py
@@ -49,7 +49,7 @@
         """Initializer.  Subclass may override.
 
         Args:
-            options: an dict containing the options passed to RefactoringTool
+            options: a dict containing the options passed to RefactoringTool
             that could be used to customize the fixer through the command line.
             log: a list to append warnings and other messages to.
         """
diff --git a/Lib/lib2to3/refactor.py b/Lib/lib2to3/refactor.py
index adf9996..0728083 100644
--- a/Lib/lib2to3/refactor.py
+++ b/Lib/lib2to3/refactor.py
@@ -184,7 +184,7 @@
 
         Args:
             fixer_names: a list of fixers to import
-            options: an dict with configuration.
+            options: a dict with configuration.
             explicit: a list of fixers to run even if they are explicit.
         """
         self.fixers = fixer_names
diff --git a/Lib/lzma.py b/Lib/lzma.py
index 89528b6..7dff1c3 100644
--- a/Lib/lzma.py
+++ b/Lib/lzma.py
@@ -279,7 +279,7 @@
     constructor: LZMAFile(filename, mode, ...). In this case, the
     encoding, errors and newline arguments must not be provided.
 
-    For text mode, a LZMAFile object is created, and wrapped in an
+    For text mode, an LZMAFile object is created, and wrapped in an
     io.TextIOWrapper instance with the specified encoding, error
     handling behavior, and line ending(s).
 
diff --git a/Lib/mailbox.py b/Lib/mailbox.py
index 24d4aec..0270e25 100644
--- a/Lib/mailbox.py
+++ b/Lib/mailbox.py
@@ -1821,7 +1821,7 @@
     _type_specific_attributes = ['_labels', '_visible']
 
     def __init__(self, message=None):
-        """Initialize an BabylMessage instance."""
+        """Initialize a BabylMessage instance."""
         self._labels = []
         self._visible = Message()
         Message.__init__(self, message)
diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py
index 776656e..c559b55 100644
--- a/Lib/multiprocessing/managers.py
+++ b/Lib/multiprocessing/managers.py
@@ -842,7 +842,7 @@
 
 def MakeProxyType(name, exposed, _cache={}):
     '''
-    Return an proxy type whose methods are given by `exposed`
+    Return a proxy type whose methods are given by `exposed`
     '''
     exposed = tuple(exposed)
     try:
diff --git a/Lib/optparse.py b/Lib/optparse.py
index 432a2eb..5bc9051 100644
--- a/Lib/optparse.py
+++ b/Lib/optparse.py
@@ -1361,7 +1361,7 @@
         sys.argv[1:]).  Any errors result in a call to 'error()', which
         by default prints the usage message to stderr and calls
         sys.exit() with an error message.  On success returns a pair
-        (values, args) where 'values' is an Values instance (with all
+        (values, args) where 'values' is a Values instance (with all
         your option values) and 'args' is the list of arguments left
         over after parsing options.
         """
diff --git a/Lib/pprint.py b/Lib/pprint.py
index 87649b4..bcf2eed 100644
--- a/Lib/pprint.py
+++ b/Lib/pprint.py
@@ -72,7 +72,7 @@
 class _safe_key:
     """Helper function for key functions when sorting unorderable objects.
 
-    The wrapped-object will fallback to an Py2.x style comparison for
+    The wrapped-object will fallback to a Py2.x style comparison for
     unorderable types (sorting first comparing the type name and then by
     the obj ids).  Does not work recursively, so dict.items() must have
     _safe_key applied to both the key and the value.
diff --git a/Lib/socket.py b/Lib/socket.py
index 95ce9eb..ac2e3dd 100644
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -685,7 +685,7 @@
     global default timeout setting returned by :func:`getdefaulttimeout`
     is used.  If *source_address* is set it must be a tuple of (host, port)
     for the socket to bind as a source address before making the connection.
-    An host of '' or port 0 tells the OS to use the default.
+    A host of '' or port 0 tells the OS to use the default.
     """
 
     host, port = address
diff --git a/Lib/socketserver.py b/Lib/socketserver.py
index f8e87e6..8808813 100644
--- a/Lib/socketserver.py
+++ b/Lib/socketserver.py
@@ -736,7 +736,7 @@
             try:
                 self.wfile.flush()
             except socket.error:
-                # An final socket error may have occurred here, such as
+                # A final socket error may have occurred here, such as
                 # the local error ECONNABORTED.
                 pass
         self.wfile.close()
diff --git a/Lib/sqlite3/test/regression.py b/Lib/sqlite3/test/regression.py
index eaaaa2c..11adb30 100644
--- a/Lib/sqlite3/test/regression.py
+++ b/Lib/sqlite3/test/regression.py
@@ -73,7 +73,7 @@
     def CheckStatementFinalizationOnCloseDb(self):
         # pysqlite versions <= 2.3.3 only finalized statements in the statement
         # cache when closing the database. statements that were still
-        # referenced in cursors weren't closed an could provoke "
+        # referenced in cursors weren't closed and could provoke "
         # "OperationalError: Unable to close due to unfinalised statements".
         con = sqlite.connect(":memory:")
         cursors = []
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 2584560..523620e 100755
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -1525,9 +1525,9 @@
 
            'x' or 'x:'  create a tarfile exclusively without compression, raise
                         an exception if the file is already created
-           'x:gz'       create an gzip compressed tarfile, raise an exception
+           'x:gz'       create a gzip compressed tarfile, raise an exception
                         if the file is already created
-           'x:bz2'      create an bzip2 compressed tarfile, raise an exception
+           'x:bz2'      create a bzip2 compressed tarfile, raise an exception
                         if the file is already created
            'x:xz'       create an lzma compressed tarfile, raise an exception
                         if the file is already created
diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py
index 135b5ab..77e72e5 100644
--- a/Lib/test/test_asyncio/test_selector_events.py
+++ b/Lib/test/test_asyncio/test_selector_events.py
@@ -1182,7 +1182,7 @@
         self.assertIs(exc, waiter.exception())
 
     def test_cancel_handshake(self):
-        # Python issue #23197: cancelling an handshake must not raise an
+        # Python issue #23197: cancelling a handshake must not raise an
         # exception or log an error, even if the handshake failed
         waiter = asyncio.Future(loop=self.loop)
         transport = self.ssl_transport(waiter=waiter)
diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py
index a72967e..e4121a0 100644
--- a/Lib/test/test_asyncio/test_sslproto.py
+++ b/Lib/test/test_asyncio/test_sslproto.py
@@ -40,7 +40,7 @@
             ssl_proto.connection_made(transport)
 
     def test_cancel_handshake(self):
-        # Python issue #23197: cancelling an handshake must not raise an
+        # Python issue #23197: cancelling a handshake must not raise an
         # exception or log an error, even if the handshake failed
         waiter = asyncio.Future(loop=self.loop)
         ssl_proto = self.ssl_protocol(waiter)
diff --git a/Lib/test/test_binop.py b/Lib/test/test_binop.py
index 823740c..e9dbddc 100644
--- a/Lib/test/test_binop.py
+++ b/Lib/test/test_binop.py
@@ -58,7 +58,7 @@
     den = property(_get_den, None)
 
     def __repr__(self):
-        """Convert a Rat to an string resembling a Rat constructor call."""
+        """Convert a Rat to a string resembling a Rat constructor call."""
         return "Rat(%d, %d)" % (self.__num, self.__den)
 
     def __str__(self):
diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py
index 12969d5..1562eec 100644
--- a/Lib/test/test_faulthandler.py
+++ b/Lib/test/test_faulthandler.py
@@ -683,7 +683,7 @@
             sys.stderr = stderr
 
     def test_stderr_None(self):
-        # Issue #21497: provide an helpful error if sys.stderr is None,
+        # Issue #21497: provide a helpful error if sys.stderr is None,
         # instead of just an attribute error: "None has no attribute fileno".
         with self.check_stderr_none():
             faulthandler.enable()
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
index 865d076..247a6b3 100644
--- a/Lib/test/test_pathlib.py
+++ b/Lib/test/test_pathlib.py
@@ -200,7 +200,7 @@
 
     def _check_str_subclass(self, *args):
         # Issue #21127: it should be possible to construct a PurePath object
-        # from an str subclass instance, and it then gets converted to
+        # from a str subclass instance, and it then gets converted to
         # a pure str object.
         class StrSubclass(str):
             pass
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index 2aa16fc..a531879 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -644,7 +644,7 @@
         self.assertEqual(os.path.abspath(sys.executable), sys.executable)
 
         # Issue #7774: Ensure that sys.executable is an empty string if argv[0]
-        # has been set to an non existent program name and Python is unable to
+        # has been set to a non existent program name and Python is unable to
         # retrieve the real program name
 
         # For a normal installation, it should work without 'cwd'
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index 06af5f2..b49a961 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -1082,7 +1082,7 @@
     eventtype = staticmethod(threading.Event)
 
 class ConditionAsRLockTests(lock_tests.RLockTests):
-    # An Condition uses an RLock by default and exports its API.
+    # Condition uses an RLock by default and exports its API.
     locktype = staticmethod(threading.Condition)
 
 class ConditionTests(lock_tests.ConditionTests):
diff --git a/Lib/test/test_tools/test_gprof2html.py b/Lib/test/test_tools/test_gprof2html.py
index 845a2a8..0c294ec 100644
--- a/Lib/test/test_tools/test_gprof2html.py
+++ b/Lib/test/test_tools/test_gprof2html.py
@@ -22,7 +22,7 @@
         sys.argv = []
 
     def test_gprof(self):
-        # Issue #14508: this used to fail with an NameError.
+        # Issue #14508: this used to fail with a NameError.
         with mock.patch.object(self.gprof, 'webbrowser') as wmock, \
                 tempfile.TemporaryDirectory() as tmpdir:
             fn = os.path.join(tmpdir, 'abc')
diff --git a/Lib/test/test_zipapp.py b/Lib/test/test_zipapp.py
index 9734380..d8d4437 100644
--- a/Lib/test/test_zipapp.py
+++ b/Lib/test/test_zipapp.py
@@ -195,7 +195,7 @@
         self.assertTrue(new_target.getvalue().startswith(b'#!python2.7\n'))
 
     def test_read_from_pathobj(self):
-        # Test that we can copy an archive using an pathlib.Path object
+        # Test that we can copy an archive using a pathlib.Path object
         # for the source.
         source = self.tmpdir / 'source'
         source.mkdir()
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index da430df..be6ed75 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -2772,7 +2772,7 @@
                     self.deletecommand(c)
         self.tk.call(self._w, 'delete', index1, index2)
     def entrycget(self, index, option):
-        """Return the resource value of an menu item for OPTION at INDEX."""
+        """Return the resource value of a menu item for OPTION at INDEX."""
         return self.tk.call(self._w, 'entrycget', index, '-' + option)
     def entryconfigure(self, index, cnf=None, **kw):
         """Configure a menu item at INDEX."""
diff --git a/Lib/tkinter/dnd.py b/Lib/tkinter/dnd.py
index 55f0776..e0971a2 100644
--- a/Lib/tkinter/dnd.py
+++ b/Lib/tkinter/dnd.py
@@ -3,7 +3,7 @@
 This is very preliminary.  I currently only support dnd *within* one
 application, between different windows (or within the same window).
 
-I an trying to make this as generic as possible -- not dependent on
+I am trying to make this as generic as possible -- not dependent on
 the use of a particular widget or icon type, etc.  I also hope that
 this will work with Pmw.
 
diff --git a/Lib/tkinter/test/test_ttk/test_functions.py b/Lib/tkinter/test/test_ttk/test_functions.py
index c9dcf97..c68a650 100644
--- a/Lib/tkinter/test/test_ttk/test_functions.py
+++ b/Lib/tkinter/test/test_ttk/test_functions.py
@@ -193,7 +193,7 @@
 
         ## Testing type = vsapi
         # vsapi type expects at least a class name and a part_id, so this
-        # should raise an ValueError since it tries to get two elements from
+        # should raise a ValueError since it tries to get two elements from
         # an empty tuple
         self.assertRaises(ValueError, ttk._format_elemcreate, 'vsapi')
 
diff --git a/Lib/tkinter/tix.py b/Lib/tkinter/tix.py
index c1cdfa7..adb629a 100644
--- a/Lib/tkinter/tix.py
+++ b/Lib/tkinter/tix.py
@@ -221,7 +221,7 @@
         self.tk.eval('package require Tix')
 
     def destroy(self):
-        # For safety, remove an delete_window binding before destroy
+        # For safety, remove the delete_window binding before destroy
         self.protocol("WM_DELETE_WINDOW", "")
         tkinter.Tk.destroy(self)
 
@@ -702,7 +702,7 @@
 
 class ExFileSelectBox(TixWidget):
     """ExFileSelectBox - MS Windows style file select box.
-    It provides an convenient method for the user to select files.
+    It provides a convenient method for the user to select files.
 
     Subwidget       Class
     ---------       -----
@@ -760,7 +760,7 @@
 # Should inherit from a Dialog class
 class ExFileSelectDialog(TixWidget):
     """ExFileSelectDialog - MS Windows style file select dialog.
-    It provides an convenient method for the user to select files.
+    It provides a convenient method for the user to select files.
 
     Subwidgets       Class
     ----------       -----
diff --git a/Lib/tkinter/ttk.py b/Lib/tkinter/ttk.py
index 244fb3d..7d868fb 100644
--- a/Lib/tkinter/ttk.py
+++ b/Lib/tkinter/ttk.py
@@ -1474,7 +1474,7 @@
     can be accessed through instance.label"""
 
     def __init__(self, master=None, variable=None, from_=0, to=10, **kw):
-        """Construct an horizontal LabeledScale with parent master, a
+        """Construct a horizontal LabeledScale with parent master, a
         variable to be associated with the Ttk Scale widget and its range.
         If variable is not specified, a tkinter.IntVar is created.
 
diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py
index e7daa07..551dce9 100644
--- a/Lib/xmlrpc/client.py
+++ b/Lib/xmlrpc/client.py
@@ -1446,7 +1446,7 @@
         # magic method dispatcher
         return _Method(self.__request, name)
 
-    # note: to call a remote object with an non-standard name, use
+    # note: to call a remote object with a non-standard name, use
     # result getattr(server, "strange-python-name")(args)
 
     def __call__(self, attr):
diff --git a/Lib/zipapp.py b/Lib/zipapp.py
index c8380bf..eceb91d 100644
--- a/Lib/zipapp.py
+++ b/Lib/zipapp.py
@@ -89,9 +89,10 @@
     The created application archive will have a shebang line specifying
     that it should run with INTERPRETER (there will be no shebang line if
     INTERPRETER is None), and a __main__.py which runs MAIN (if MAIN is
-    not specified, an existing __main__.py will be used). It is an to specify
-    MAIN for anything other than a directory source with no __main__.py, and it
-    is an error to omit MAIN if the directory has no __main__.py.
+    not specified, an existing __main__.py will be used).  It is an error
+    to specify MAIN for anything other than a directory source with no
+    __main__.py, and it is an error to omit MAIN if the directory has no
+    __main__.py.
     """
     # Are we copying an existing archive?
     source_is_file = False