Skip to content

Commit c04fb56

Browse files
committed
Issue python#26304: Change "allows to <verb>" to "allows <verb>ing" or similar
The original form is incorrect grammar and feels awkward, even though the meaning is clear.
1 parent 96a4f07 commit c04fb56

File tree

25 files changed

+76
-76
lines changed

25 files changed

+76
-76
lines changed

Doc/c-api/arg.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ variable(s) whose address should be passed.
3030
Strings and buffers
3131
-------------------
3232

33-
These formats allow to access an object as a contiguous chunk of memory.
33+
These formats allow accessing an object as a contiguous chunk of memory.
3434
You don't have to provide raw storage for the returned unicode or bytes
3535
area. Also, you won't have to release any memory yourself, except with the
3636
``es``, ``es#``, ``et`` and ``et#`` formats.

Doc/c-api/function.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ There are a few functions specific to Python functions.
4040
4141
.. c:function:: PyObject* PyFunction_NewWithQualName(PyObject *code, PyObject *globals, PyObject *qualname)
4242
43-
As :c:func:`PyFunction_New`, but also allows to set the function object's
43+
As :c:func:`PyFunction_New`, but also allows setting the function object's
4444
``__qualname__`` attribute. *qualname* should be a unicode object or NULL;
4545
if NULL, the ``__qualname__`` attribute is set to the same value as its
4646
``__name__`` attribute.

Doc/howto/pyporting.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ bothered to add the ``b`` mode when opening a binary file (e.g., ``rb`` for
243243
binary reading). Under Python 3, binary files and text files are clearly
244244
distinct and mutually incompatible; see the :mod:`io` module for details.
245245
Therefore, you **must** make a decision of whether a file will be used for
246-
binary access (allowing to read and/or write binary data) or text access
247-
(allowing to read and/or write text data). You should also use :func:`io.open`
246+
binary access (allowing binary data to be read and/or written) or text access
247+
(allowing text data to be read and/or written). You should also use :func:`io.open`
248248
for opening files instead of the built-in :func:`open` function as the :mod:`io`
249249
module is consistent from Python 2 to 3 while the built-in :func:`open` function
250250
is not (in Python 3 it's actually :func:`io.open`).

Doc/library/asyncio-eventloop.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ Creating connections
253253
a class. For example, if you want to use a pre-created
254254
protocol instance, you can pass ``lambda: my_protocol``.
255255

256-
Options allowing to change how the connection is created:
256+
Options that change how the connection is created:
257257

258258
* *ssl*: if given and not false, a SSL/TLS transport is created
259259
(by default a plain TCP transport is created). If *ssl* is
@@ -654,7 +654,7 @@ pool of processes). By default, an event loop uses a thread pool executor
654654
Error Handling API
655655
------------------
656656

657-
Allows to customize how exceptions are handled in the event loop.
657+
Allows customizing how exceptions are handled in the event loop.
658658

659659
.. method:: BaseEventLoop.set_exception_handler(handler)
660660

Doc/library/asyncio-task.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ Task functions
510510

511511
.. note::
512512

513-
In the functions below, the optional *loop* argument allows to explicitly set
513+
In the functions below, the optional *loop* argument allows explicitly setting
514514
the event loop object used by the underlying task or coroutine. If it's
515515
not provided, the default event loop is used.
516516

Doc/library/ctypes.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ other, and finally follow the pointer chain a few times::
942942
Callback functions
943943
^^^^^^^^^^^^^^^^^^
944944

945-
:mod:`ctypes` allows to create C callable function pointers from Python callables.
945+
:mod:`ctypes` allows creating C callable function pointers from Python callables.
946946
These are sometimes called *callback functions*.
947947

948948
First, you must create a class for the callback function. The class knows the
@@ -1350,7 +1350,7 @@ details, consult the :manpage:`dlopen(3)` manpage, on Windows, *mode* is
13501350
ignored.
13511351

13521352
The *use_errno* parameter, when set to True, enables a ctypes mechanism that
1353-
allows to access the system :data:`errno` error number in a safe way.
1353+
allows accessing the system :data:`errno` error number in a safe way.
13541354
:mod:`ctypes` maintains a thread-local copy of the systems :data:`errno`
13551355
variable; if you call foreign functions created with ``use_errno=True`` then the
13561356
:data:`errno` value before the function call is swapped with the ctypes private
@@ -1421,7 +1421,7 @@ loader instance.
14211421
Class which loads shared libraries. *dlltype* should be one of the
14221422
:class:`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types.
14231423

1424-
:meth:`__getattr__` has special behavior: It allows to load a shared library by
1424+
:meth:`__getattr__` has special behavior: It allows loading a shared library by
14251425
accessing it as attribute of a library loader instance. The result is cached,
14261426
so repeated attribute accesses return the same library each time.
14271427

@@ -1498,7 +1498,7 @@ They are instances of a private class:
14981498

14991499
It is possible to assign a callable Python object that is not a ctypes
15001500
type, in this case the function is assumed to return a C :c:type:`int`, and
1501-
the callable will be called with this integer, allowing to do further
1501+
the callable will be called with this integer, allowing further
15021502
processing or error checking. Using this is deprecated, for more flexible
15031503
post processing or error checking use a ctypes data type as
15041504
:attr:`restype` and assign a callable to the :attr:`errcheck` attribute.
@@ -1513,15 +1513,15 @@ They are instances of a private class:
15131513

15141514
When a foreign function is called, each actual argument is passed to the
15151515
:meth:`from_param` class method of the items in the :attr:`argtypes`
1516-
tuple, this method allows to adapt the actual argument to an object that
1516+
tuple, this method allows adapting the actual argument to an object that
15171517
the foreign function accepts. For example, a :class:`c_char_p` item in
15181518
the :attr:`argtypes` tuple will convert a string passed as argument into
15191519
a bytes object using ctypes conversion rules.
15201520

15211521
New: It is now possible to put items in argtypes which are not ctypes
15221522
types, but each item must have a :meth:`from_param` method which returns a
15231523
value usable as argument (integer, string, ctypes instance). This allows
1524-
to define adapters that can adapt custom objects as function parameters.
1524+
defining adapters that can adapt custom objects as function parameters.
15251525

15261526
.. attribute:: errcheck
15271527

@@ -1535,12 +1535,12 @@ They are instances of a private class:
15351535
*result* is what the foreign function returns, as specified by the
15361536
:attr:`restype` attribute.
15371537

1538-
*func* is the foreign function object itself, this allows to reuse the
1538+
*func* is the foreign function object itself, this allows reusing the
15391539
same callable object to check or post process the results of several
15401540
functions.
15411541

15421542
*arguments* is a tuple containing the parameters originally passed to
1543-
the function call, this allows to specialize the behavior on the
1543+
the function call, this allows specializing the behavior on the
15441544
arguments used.
15451545

15461546
The object that this function returns will be returned from the
@@ -1785,7 +1785,7 @@ Utility functions
17851785
If a bytes object is specified as first argument, the buffer is made one item
17861786
larger than its length so that the last element in the array is a NUL
17871787
termination character. An integer can be passed as second argument which allows
1788-
to specify the size of the array if the length of the bytes should not be used.
1788+
specifying the size of the array if the length of the bytes should not be used.
17891789

17901790

17911791

@@ -1800,21 +1800,21 @@ Utility functions
18001800
If a string is specified as first argument, the buffer is made one item
18011801
larger than the length of the string so that the last element in the array is a
18021802
NUL termination character. An integer can be passed as second argument which
1803-
allows to specify the size of the array if the length of the string should not
1803+
allows specifying the size of the array if the length of the string should not
18041804
be used.
18051805

18061806

18071807

18081808
.. function:: DllCanUnloadNow()
18091809

1810-
Windows only: This function is a hook which allows to implement in-process
1810+
Windows only: This function is a hook which allows implementing in-process
18111811
COM servers with ctypes. It is called from the DllCanUnloadNow function that
18121812
the _ctypes extension dll exports.
18131813

18141814

18151815
.. function:: DllGetClassObject()
18161816

1817-
Windows only: This function is a hook which allows to implement in-process
1817+
Windows only: This function is a hook which allows implementing in-process
18181818
COM servers with ctypes. It is called from the DllGetClassObject function
18191819
that the ``_ctypes`` extension dll exports.
18201820

@@ -2321,7 +2321,7 @@ other data types containing pointer type fields.
23212321
checked, only one field can be accessed when names are repeated.
23222322

23232323
It is possible to define the :attr:`_fields_` class variable *after* the
2324-
class statement that defines the Structure subclass, this allows to create
2324+
class statement that defines the Structure subclass, this allows creating
23252325
data types that directly or indirectly reference themselves::
23262326

23272327
class List(Structure):
@@ -2342,7 +2342,7 @@ other data types containing pointer type fields.
23422342

23432343
.. attribute:: _pack_
23442344

2345-
An optional small integer that allows to override the alignment of
2345+
An optional small integer that allows overriding the alignment of
23462346
structure fields in the instance. :attr:`_pack_` must already be defined
23472347
when :attr:`_fields_` is assigned, otherwise it will have no effect.
23482348

@@ -2354,8 +2354,8 @@ other data types containing pointer type fields.
23542354
assigned, otherwise it will have no effect.
23552355

23562356
The fields listed in this variable must be structure or union type fields.
2357-
:mod:`ctypes` will create descriptors in the structure type that allows to
2358-
access the nested fields directly, without the need to create the
2357+
:mod:`ctypes` will create descriptors in the structure type that allows
2358+
accessing the nested fields directly, without the need to create the
23592359
structure or union field.
23602360

23612361
Here is an example type (Windows)::

Doc/library/nis.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The :mod:`nis` module defines the following functions:
2626

2727
Note that *mapname* is first checked if it is an alias to another name.
2828

29-
The *domain* argument allows to override the NIS domain used for the lookup. If
29+
The *domain* argument allows overriding the NIS domain used for the lookup. If
3030
unspecified, lookup is in the default NIS domain.
3131

3232

@@ -38,15 +38,15 @@ The :mod:`nis` module defines the following functions:
3838

3939
Note that *mapname* is first checked if it is an alias to another name.
4040

41-
The *domain* argument allows to override the NIS domain used for the lookup. If
41+
The *domain* argument allows overriding the NIS domain used for the lookup. If
4242
unspecified, lookup is in the default NIS domain.
4343

4444

4545
.. function:: maps(domain=default_domain)
4646

4747
Return a list of all valid maps.
4848

49-
The *domain* argument allows to override the NIS domain used for the lookup. If
49+
The *domain* argument allows overriding the NIS domain used for the lookup. If
5050
unspecified, lookup is in the default NIS domain.
5151

5252

Doc/library/signal.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This module provides mechanisms to use signal handlers in Python.
1111
General rules
1212
-------------
1313

14-
The :func:`signal.signal` function allows to define custom handlers to be
14+
The :func:`signal.signal` function allows defining custom handlers to be
1515
executed when a signal is received. A small number of default handlers are
1616
installed: :const:`SIGPIPE` is ignored (so write errors on pipes and sockets
1717
can be reported as ordinary Python exceptions) and :const:`SIGINT` is

Doc/library/smtplib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
3333
*timeout* parameter specifies a timeout in seconds for blocking operations
3434
like the connection attempt (if not specified, the global default timeout
3535
setting will be used). If the timeout expires, :exc:`socket.timeout` is
36-
raised. The optional source_address parameter allows to bind
36+
raised. The optional source_address parameter allows binding
3737
to some specific source address in a machine with multiple network
3838
interfaces, and/or to some specific source TCP port. It takes a 2-tuple
3939
(host, port), for the socket to bind to as its source address before
@@ -76,7 +76,7 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
7676
*port* is zero, the standard SMTP-over-SSL port (465) is used. The optional
7777
arguments *local_hostname*, *timeout* and *source_address* have the same
7878
meaning as they do in the :class:`SMTP` class. *context*, also optional,
79-
can contain a :class:`~ssl.SSLContext` and allows to configure various
79+
can contain a :class:`~ssl.SSLContext` and allows configuring various
8080
aspects of the secure connection. Please read :ref:`ssl-security` for
8181
best practices.
8282

Doc/library/tarfile.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Some facts and figures:
111111
specifies the blocksize and defaults to ``20 * 512`` bytes. Use this variant
112112
in combination with e.g. ``sys.stdin``, a socket :term:`file object` or a tape
113113
device. However, such a :class:`TarFile` object is limited in that it does
114-
not allow to be accessed randomly, see :ref:`tar-examples`. The currently
114+
not allow random access, see :ref:`tar-examples`. The currently
115115
possible modes:
116116

117117
+-------------+--------------------------------------------+

0 commit comments

Comments
 (0)