Skip to content

Commit 7462b64

Browse files
committed
Issue python#25523: Correct "a" article to "an" article
This changes the main documentation, doc strings, source code comments, and a couple error messages in the test suite. In some cases the word was removed or edited some other way to fix the grammar.
1 parent 314464d commit 7462b64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+136
-136
lines changed

Doc/c-api/buffer.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ protocol <bufferobjects>`. This protocol has two sides:
4040

4141
Simple objects such as :class:`bytes` and :class:`bytearray` expose their
4242
underlying buffer in byte-oriented form. Other forms are possible; for example,
43-
the elements exposed by a :class:`array.array` can be multi-byte values.
43+
the elements exposed by an :class:`array.array` can be multi-byte values.
4444

4545
An example consumer of the buffer interface is the :meth:`~io.BufferedIOBase.write`
4646
method of file objects: any object that can export a series of bytes through

Doc/faq/programming.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ How do I modify a string in place?
849849
You can't, because strings are immutable. In most situations, you should
850850
simply construct a new string from the various parts you want to assemble
851851
it from. However, if you need an object with the ability to modify in-place
852-
unicode data, try using a :class:`io.StringIO` object or the :mod:`array`
852+
unicode data, try using an :class:`io.StringIO` object or the :mod:`array`
853853
module::
854854

855855
>>> import io

Doc/library/chunk.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Usually an IFF-type file consists of one or more chunks. The proposed usage of
4747
the :class:`Chunk` class defined here is to instantiate an instance at the start
4848
of each chunk and read from the instance until it reaches the end, after which a
4949
new instance can be instantiated. At the end of the file, creating a new
50-
instance will fail with a :exc:`EOFError` exception.
50+
instance will fail with an :exc:`EOFError` exception.
5151

5252

5353
.. class:: Chunk(file, align=True, bigendian=True, inclheader=False)

Doc/library/concurrent.futures.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Executor Objects
8181
ThreadPoolExecutor
8282
------------------
8383

84-
:class:`ThreadPoolExecutor` is a :class:`Executor` subclass that uses a pool of
84+
:class:`ThreadPoolExecutor` is an :class:`Executor` subclass that uses a pool of
8585
threads to execute calls asynchronously.
8686

8787
Deadlocks can occur when the callable associated with a :class:`Future` waits on
@@ -285,7 +285,7 @@ The :class:`Future` class encapsulates the asynchronous execution of a callable.
285285

286286
Added callables are called in the order that they were added and are
287287
always called in a thread belonging to the process that added them. If
288-
the callable raises a :exc:`Exception` subclass, it will be logged and
288+
the callable raises an :exc:`Exception` subclass, it will be logged and
289289
ignored. If the callable raises a :exc:`BaseException` subclass, the
290290
behavior is undefined.
291291

Doc/library/ctypes.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ loads libraries which export functions using the standard ``cdecl`` calling
3939
convention, while *windll* libraries call functions using the ``stdcall``
4040
calling convention. *oledll* also uses the ``stdcall`` calling convention, and
4141
assumes the functions return a Windows :c:type:`HRESULT` error code. The error
42-
code is used to automatically raise a :class:`OSError` exception when the
42+
code is used to automatically raise an :class:`OSError` exception when the
4343
function call fails.
4444

4545
.. versionchanged:: 3.3

Doc/library/difflib.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
269269
generating the delta lines) in unified diff format.
270270

271271
Unified diffs are a compact way of showing just the lines that have changed plus
272-
a few lines of context. The changes are shown in a inline style (instead of
272+
a few lines of context. The changes are shown in an inline style (instead of
273273
separate before/after blocks). The number of context lines is set by *n* which
274274
defaults to three.
275275

Doc/library/fcntl.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ interface to the :c:func:`fcntl` and :c:func:`ioctl` Unix routines.
1616

1717
All functions in this module take a file descriptor *fd* as their first
1818
argument. This can be an integer file descriptor, such as returned by
19-
``sys.stdin.fileno()``, or a :class:`io.IOBase` object, such as ``sys.stdin``
19+
``sys.stdin.fileno()``, or an :class:`io.IOBase` object, such as ``sys.stdin``
2020
itself, which provides a :meth:`~io.IOBase.fileno` that returns a genuine file
2121
descriptor.
2222

2323
.. versionchanged:: 3.3
24-
Operations in this module used to raise a :exc:`IOError` where they now
25-
raise a :exc:`OSError`.
24+
Operations in this module used to raise an :exc:`IOError` where they now
25+
raise an :exc:`OSError`.
2626

2727

2828
The module defines the following functions:

Doc/library/ftplib.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ followed by ``lines`` for the text version or ``binary`` for the binary version.
287287

288288
.. method:: FTP.transfercmd(cmd, rest=None)
289289

290-
Initiate a transfer over the data connection. If the transfer is active, send a
290+
Initiate a transfer over the data connection. If the transfer is active, send an
291291
``EPRT`` or ``PORT`` command and the transfer command specified by *cmd*, and
292-
accept the connection. If the server is passive, send a ``EPSV`` or ``PASV``
292+
accept the connection. If the server is passive, send an ``EPSV`` or ``PASV``
293293
command, connect to it, and start the transfer command. Either way, return the
294294
socket for the connection.
295295

Doc/library/functions.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1029,9 +1029,9 @@ are always available. They are listed here in alphabetical order.
10291029
:class:`io.TextIOBase` (specifically :class:`io.TextIOWrapper`). When used
10301030
to open a file in a binary mode with buffering, the returned class is a
10311031
subclass of :class:`io.BufferedIOBase`. The exact class varies: in read
1032-
binary mode, it returns a :class:`io.BufferedReader`; in write binary and
1033-
append binary modes, it returns a :class:`io.BufferedWriter`, and in
1034-
read/write mode, it returns a :class:`io.BufferedRandom`. When buffering is
1032+
binary mode, it returns an :class:`io.BufferedReader`; in write binary and
1033+
append binary modes, it returns an :class:`io.BufferedWriter`, and in
1034+
read/write mode, it returns an :class:`io.BufferedRandom`. When buffering is
10351035
disabled, the raw stream, a subclass of :class:`io.RawIOBase`,
10361036
:class:`io.FileIO`, is returned.
10371037

Doc/library/gzip.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ The module defines the following items:
100100

101101
Calling a :class:`GzipFile` object's :meth:`close` method does not close
102102
*fileobj*, since you might wish to append more material after the compressed
103-
data. This also allows you to pass a :class:`io.BytesIO` object opened for
103+
data. This also allows you to pass an :class:`io.BytesIO` object opened for
104104
writing as *fileobj*, and retrieve the resulting memory buffer using the
105105
:class:`io.BytesIO` object's :meth:`~io.BytesIO.getvalue` method.
106106

Doc/library/http.cookiejar.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ contained :class:`Cookie` objects.
176176

177177
The *response* object (usually the result of a call to
178178
:meth:`urllib.request.urlopen`, or similar) should support an :meth:`info`
179-
method, which returns a :class:`email.message.Message` instance.
179+
method, which returns an :class:`email.message.Message` instance.
180180

181181
The *request* object (usually a :class:`urllib.request.Request` instance)
182182
must support the methods :meth:`get_full_url`, :meth:`get_host`,

Doc/library/http.server.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ of which this module provides three different variants:
176176

177177
.. method:: handle_expect_100()
178178

179-
When a HTTP/1.1 compliant server receives a ``Expect: 100-continue``
179+
When a HTTP/1.1 compliant server receives an ``Expect: 100-continue``
180180
request header it responds back with a ``100 Continue`` followed by ``200
181181
OK`` headers.
182182
This method can be overridden to raise an error if the server does not
@@ -210,7 +210,7 @@ of which this module provides three different variants:
210210
are picked up from the :meth:`version_string` and
211211
:meth:`date_time_string` methods, respectively. If the server does not
212212
intend to send any other headers using the :meth:`send_header` method,
213-
then :meth:`send_response` should be followed by a :meth:`end_headers`
213+
then :meth:`send_response` should be followed by an :meth:`end_headers`
214214
call.
215215

216216
.. versionchanged:: 3.3

Doc/library/mailbox.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ Supported mailbox formats are Maildir, mbox, MH, Babyl, and MMDF.
674674

675675
In Babyl mailboxes, the headers of a message are not stored contiguously
676676
with the body of the message. To generate a file-like representation, the
677-
headers and body are copied together into a :class:`io.BytesIO` instance,
677+
headers and body are copied together into an :class:`io.BytesIO` instance,
678678
which has an API identical to that of a
679679
file. As a result, the file-like object is truly independent of the
680680
underlying mailbox but does not save memory compared to a string

Doc/library/multiprocessing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ Connection objects are usually created using :func:`Pipe` -- see also
10411041
readable.
10421042

10431043
.. versionchanged:: 3.3
1044-
This function used to raise a :exc:`IOError`, which is now an
1044+
This function used to raise :exc:`IOError`, which is now an
10451045
alias of :exc:`OSError`.
10461046

10471047

Doc/library/nntplib.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ tuples or objects that the method normally returns will be empty.
341341

342342
.. method:: NNTP.over(message_spec, *, file=None)
343343

344-
Send a ``OVER`` command, or a ``XOVER`` command on legacy servers.
344+
Send an ``OVER`` command, or an ``XOVER`` command on legacy servers.
345345
*message_spec* can be either a string representing a message id, or
346346
a ``(first, last)`` tuple of numbers indicating a range of articles in
347347
the current group, or a ``(first, None)`` tuple indicating a range of

Doc/library/optparse.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@ where the input parameters are
13241324
the list of arguments to process (default: ``sys.argv[1:]``)
13251325

13261326
``values``
1327-
a :class:`optparse.Values` object to store option arguments in (default: a
1327+
an :class:`optparse.Values` object to store option arguments in (default: a
13281328
new instance of :class:`Values`) -- if you give an existing object, the
13291329
option defaults will not be initialized on it
13301330

Doc/library/os.path.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ the :mod:`glob` module.)
263263

264264
Return ``True`` if both pathname arguments refer to the same file or directory.
265265
This is determined by the device number and i-node number and raises an
266-
exception if a :func:`os.stat` call on either pathname fails.
266+
exception if an :func:`os.stat` call on either pathname fails.
267267

268268
Availability: Unix, Windows.
269269

Doc/library/pickle.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ process more convenient:
221221
The argument *file* must have two methods, a read() method that takes an
222222
integer argument, and a readline() method that requires no arguments. Both
223223
methods should return bytes. Thus *file* can be an on-disk file opened for
224-
binary reading, a :class:`io.BytesIO` object, or any other custom object
224+
binary reading, an :class:`io.BytesIO` object, or any other custom object
225225
that meets this interface.
226226

227227
Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
@@ -357,7 +357,7 @@ The :mod:`pickle` module exports two classes, :class:`Pickler` and
357357
The argument *file* must have two methods, a read() method that takes an
358358
integer argument, and a readline() method that requires no arguments. Both
359359
methods should return bytes. Thus *file* can be an on-disk file object
360-
opened for binary reading, a :class:`io.BytesIO` object, or any other
360+
opened for binary reading, an :class:`io.BytesIO` object, or any other
361361
custom object that meets this interface.
362362

363363
Optional keyword arguments are *fix_imports*, *encoding* and *errors*,

Doc/library/pyexpat.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ The ``errors`` module has the following attributes:
763763

764764
.. data:: XML_ERROR_UNDEFINED_ENTITY
765765

766-
A reference was made to a entity which was not defined.
766+
A reference was made to an entity which was not defined.
767767

768768

769769
.. data:: XML_ERROR_UNKNOWN_ENCODING

Doc/library/shutil.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ Directory and files operations
206206
and metadata of the linked files are copied to the new tree.
207207

208208
When *symlinks* is false, if the file pointed by the symlink doesn't
209-
exist, a exception will be added in the list of errors raised in
210-
a :exc:`Error` exception at the end of the copy process.
209+
exist, an exception will be added in the list of errors raised in
210+
an :exc:`Error` exception at the end of the copy process.
211211
You can set the optional *ignore_dangling_symlinks* flag to true if you
212212
want to silence this exception. Notice that this option has no effect
213213
on platforms that don't support :func:`os.symlink`.

Doc/library/smtplib.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
2222

2323
.. class:: SMTP(host='', port=0, local_hostname=None[, timeout], source_address=None)
2424

25-
A :class:`SMTP` instance encapsulates an SMTP connection. It has methods
25+
An :class:`SMTP` instance encapsulates an SMTP connection. It has methods
2626
that support a full repertoire of SMTP and ESMTP operations. If the optional
2727
host and port parameters are given, the SMTP :meth:`connect` method is
2828
called with those parameters during initialization. If specified,
@@ -65,7 +65,7 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
6565
certfile=None [, timeout], context=None, \
6666
source_address=None)
6767

68-
A :class:`SMTP_SSL` instance behaves exactly the same as instances of
68+
An :class:`SMTP_SSL` instance behaves exactly the same as instances of
6969
:class:`SMTP`. :class:`SMTP_SSL` should be used for situations where SSL is
7070
required from the beginning of the connection and using :meth:`starttls` is
7171
not appropriate. If *host* is not specified, the local host is used. If

Doc/library/socket.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ The :mod:`socket` module also offers various network-related services:
693693

694694
Supported values for *address_family* are currently :const:`AF_INET` and
695695
:const:`AF_INET6`. If the string *packed_ip* is not the correct length for the
696-
specified address family, :exc:`ValueError` will be raised. A
696+
specified address family, :exc:`ValueError` will be raised.
697697
:exc:`OSError` is raised for errors from the call to :func:`inet_ntop`.
698698

699699
Availability: Unix (maybe not all platforms), Windows.
@@ -969,7 +969,7 @@ to sockets.
969969
interpreted the same way as by the built-in :func:`open` function.
970970

971971
The socket must be in blocking mode; it can have a timeout, but the file
972-
object's internal buffer may end up in a inconsistent state if a timeout
972+
object's internal buffer may end up in an inconsistent state if a timeout
973973
occurs.
974974

975975
Closing the file object returned by :meth:`makefile` won't close the

Doc/library/sqlite3.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ Cursor Objects
615615
.. attribute:: lastrowid
616616

617617
This read-only attribute provides the rowid of the last modified row. It is
618-
only set if you issued a ``INSERT`` statement using the :meth:`execute`
618+
only set if you issued an ``INSERT`` statement using the :meth:`execute`
619619
method. For operations other than ``INSERT`` or when :meth:`executemany` is
620620
called, :attr:`lastrowid` is set to :const:`None`.
621621

Doc/library/stdtypes.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ Notes:
951951
runtime cost, you must switch to one of the alternatives below:
952952

953953
* if concatenating :class:`str` objects, you can build a list and use
954-
:meth:`str.join` at the end or else write to a :class:`io.StringIO`
954+
:meth:`str.join` at the end or else write to an :class:`io.StringIO`
955955
instance and retrieve its value when complete
956956

957957
* if concatenating :class:`bytes` objects, you can similarly use

Doc/library/sunau.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ The :mod:`sunau` module defines the following functions:
5454

5555
Note that it does not allow read/write files.
5656

57-
A *mode* of ``'r'`` returns a :class:`AU_read` object, while a *mode* of ``'w'``
58-
or ``'wb'`` returns a :class:`AU_write` object.
57+
A *mode* of ``'r'`` returns an :class:`AU_read` object, while a *mode* of ``'w'``
58+
or ``'wb'`` returns an :class:`AU_write` object.
5959

6060

6161
.. function:: openfp(file, mode)

Doc/library/tempfile.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The module defines the following user-callable items:
8282
causes the file to roll over to an on-disk file regardless of its size.
8383

8484
The returned object is a file-like object whose :attr:`_file` attribute
85-
is either a :class:`io.BytesIO` or :class:`io.StringIO` object (depending on
85+
is either an :class:`io.BytesIO` or :class:`io.StringIO` object (depending on
8686
whether binary or text *mode* was specified) or a true file
8787
object, depending on whether :func:`rollover` has been called. This
8888
file-like object can be used in a :keyword:`with` statement, just like

Doc/library/unittest.mock.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ you wanted a :class:`NonCallableMock` to be used:
11051105
...
11061106
TypeError: 'NonCallableMock' object is not callable
11071107

1108-
Another use case might be to replace an object with a :class:`io.StringIO` instance:
1108+
Another use case might be to replace an object with an :class:`io.StringIO` instance:
11091109

11101110
>>> from io import StringIO
11111111
>>> def foo():

Doc/library/xml.dom.pulldom.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Example::
4747
* :data:`PROCESSING_INSTRUCTION`
4848
* :data:`IGNORABLE_WHITESPACE`
4949

50-
``node`` is a object of type :class:`xml.dom.minidom.Document`,
50+
``node`` is an object of type :class:`xml.dom.minidom.Document`,
5151
:class:`xml.dom.minidom.Element` or :class:`xml.dom.minidom.Text`.
5252

5353
Since the document is treated as a "flat" stream of events, the document "tree"

Doc/tutorial/errors.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ example::
336336
A *finally clause* is always executed before leaving the :keyword:`try`
337337
statement, whether an exception has occurred or not. When an exception has
338338
occurred in the :keyword:`try` clause and has not been handled by an
339-
:keyword:`except` clause (or it has occurred in a :keyword:`except` or
339+
:keyword:`except` clause (or it has occurred in an :keyword:`except` or
340340
:keyword:`else` clause), it is re-raised after the :keyword:`finally` clause has
341341
been executed. The :keyword:`finally` clause is also executed "on the way out"
342342
when any other clause of the :keyword:`try` statement is left via a

Doc/tutorial/introduction.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ For non-negative indices, the length of a slice is the difference of the
303303
indices, if both are within bounds. For example, the length of ``word[1:3]`` is
304304
2.
305305

306-
Attempting to use a index that is too large will result in an error::
306+
Attempting to use an index that is too large will result in an error::
307307

308308
>>> word[42] # the word only has 6 characters
309309
Traceback (most recent call last):

Doc/whatsnew/2.1.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ will include metadata, making it possible to build automated cataloguing systems
555555
and experiment with them. With the result experience, perhaps it'll be possible
556556
to design a really good catalog and then build support for it into Python 2.2.
557557
For example, the Distutils :command:`sdist` and :command:`bdist_\*` commands
558-
could support a ``upload`` option that would automatically upload your
558+
could support an ``upload`` option that would automatically upload your
559559
package to a catalog server.
560560

561561
You can start creating packages containing :file:`PKG-INFO` even if you're not

Doc/whatsnew/2.3.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ PEP 279: enumerate()
411411

412412
A new built-in function, :func:`enumerate`, will make certain loops a bit
413413
clearer. ``enumerate(thing)``, where *thing* is either an iterator or a
414-
sequence, returns a iterator that will return ``(0, thing[0])``, ``(1,
414+
sequence, returns an iterator that will return ``(0, thing[0])``, ``(1,
415415
thing[1])``, ``(2, thing[2])``, and so forth.
416416

417417
A common idiom to change every element of a list looks like this::

Doc/whatsnew/3.1.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ New, Improved, and Deprecated Modules
336336
(Contributed by David Laban; :issue:`4739`.)
337337

338338
* The :mod:`unittest` module now supports skipping individual tests or classes
339-
of tests. And it supports marking a test as a expected failure, a test that
339+
of tests. And it supports marking a test as an expected failure, a test that
340340
is known to be broken, but shouldn't be counted as a failure on a
341341
TestResult::
342342

Doc/whatsnew/3.2.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ functools
788788
:issue:`8814`.)
789789

790790
* To help write classes with rich comparison methods, a new decorator
791-
:func:`functools.total_ordering` will use a existing equality and inequality
791+
:func:`functools.total_ordering` will use existing equality and inequality
792792
methods to fill in the remaining methods.
793793

794794
For example, supplying *__eq__* and *__lt__* will enable
@@ -1399,7 +1399,7 @@ Aides and Brian Curtin in :issue:`9962`, :issue:`1675951`, :issue:`7471` and
13991399

14001400
Also, the :class:`zipfile.ZipExtFile` class was reworked internally to represent
14011401
files stored inside an archive. The new implementation is significantly faster
1402-
and can be wrapped in a :class:`io.BufferedReader` object for more speedups. It
1402+
and can be wrapped in an :class:`io.BufferedReader` object for more speedups. It
14031403
also solves an issue where interleaved calls to *read* and *readline* gave the
14041404
wrong results.
14051405

0 commit comments

Comments
 (0)