Skip to content

Commit f7bf057

Browse files
committed
Consistent spacing is apre-requisite toconsistently good writing.
1 parent a2a1bc1 commit f7bf057

File tree

10 files changed

+60
-60
lines changed

10 files changed

+60
-60
lines changed

Doc/c-api/buffer.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ a buffer, see :c:func:`PyObject_GetBuffer`.
142142

143143
Important exception: If a consumer requests a buffer without the
144144
:c:macro:`PyBUF_FORMAT` flag, :c:member:`~Py_buffer.format` will
145-
be set to ``NULL``, ut :c:member:`~Py_buffer.itemsize` still has
145+
be set to ``NULL``, but :c:member:`~Py_buffer.itemsize` still has
146146
the value for the original format.
147147

148148
If :c:member:`~Py_buffer.shape` is present, the equality
@@ -446,14 +446,14 @@ Buffer-related functions
446446

447447
.. c:function:: int PyObject_CheckBuffer(PyObject *obj)
448448
449-
Return ``1`` if *obj* supports the buffer interface otherwise ``0``. When ``1`` is
449+
Return ``1`` if *obj* supports the buffer interface otherwise ``0``. When ``1`` is
450450
returned, it doesn't guarantee that :c:func:`PyObject_GetBuffer` will
451-
succeed. This function always succeeds.
451+
succeed. This function always succeeds.
452452
453453
454454
.. c:function:: int PyObject_GetBuffer(PyObject *exporter, Py_buffer *view, int flags)
455455
456-
Send a request to *exporter* to fill in *view* as specified by *flags*.
456+
Send a request to *exporter* to fill in *view* as specified by *flags*.
457457
If the exporter cannot provide a buffer of the exact type, it MUST raise
458458
:exc:`BufferError`, set ``view->obj`` to ``NULL`` and
459459
return ``-1``.
@@ -492,7 +492,7 @@ Buffer-related functions
492492
493493
Return ``1`` if the memory defined by the *view* is C-style (*order* is
494494
``'C'``) or Fortran-style (*order* is ``'F'``) :term:`contiguous` or either one
495-
(*order* is ``'A'``). Return ``0`` otherwise. This function always succeeds.
495+
(*order* is ``'A'``). Return ``0`` otherwise. This function always succeeds.
496496
497497
498498
.. c:function:: void* PyBuffer_GetPointer(const Py_buffer *view, const Py_ssize_t *indices)

Doc/c-api/bytearray.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ Type check macros
2525
.. c:function:: int PyByteArray_Check(PyObject *o)
2626
2727
Return true if the object *o* is a bytearray object or an instance of a
28-
subtype of the bytearray type. This function always succeeds.
28+
subtype of the bytearray type. This function always succeeds.
2929
3030
3131
.. c:function:: int PyByteArray_CheckExact(PyObject *o)
3232
3333
Return true if the object *o* is a bytearray object, but not an instance of a
34-
subtype of the bytearray type. This function always succeeds.
34+
subtype of the bytearray type. This function always succeeds.
3535
3636
3737
Direct API functions
@@ -67,7 +67,7 @@ Direct API functions
6767
.. c:function:: char* PyByteArray_AsString(PyObject *bytearray)
6868
6969
Return the contents of *bytearray* as a char array after checking for a
70-
``NULL`` pointer. The returned array always has an extra
70+
``NULL`` pointer. The returned array always has an extra
7171
null byte appended.
7272
7373

Doc/c-api/bytes.rst

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,36 +25,36 @@ called with a non-bytes parameter.
2525
.. c:function:: int PyBytes_Check(PyObject *o)
2626
2727
Return true if the object *o* is a bytes object or an instance of a subtype
28-
of the bytes type. This function always succeeds.
28+
of the bytes type. This function always succeeds.
2929
3030
3131
.. c:function:: int PyBytes_CheckExact(PyObject *o)
3232
3333
Return true if the object *o* is a bytes object, but not an instance of a
34-
subtype of the bytes type. This function always succeeds.
34+
subtype of the bytes type. This function always succeeds.
3535
3636
3737
.. c:function:: PyObject* PyBytes_FromString(const char *v)
3838
3939
Return a new bytes object with a copy of the string *v* as value on success,
40-
and ``NULL`` on failure. The parameter *v* must not be ``NULL``; it will not be
40+
and ``NULL`` on failure. The parameter *v* must not be ``NULL``; it will not be
4141
checked.
4242
4343
4444
.. c:function:: PyObject* PyBytes_FromStringAndSize(const char *v, Py_ssize_t len)
4545
4646
Return a new bytes object with a copy of the string *v* as value and length
47-
*len* on success, and ``NULL`` on failure. If *v* is ``NULL``, the contents of
47+
*len* on success, and ``NULL`` on failure. If *v* is ``NULL``, the contents of
4848
the bytes object are uninitialized.
4949
5050
5151
.. c:function:: PyObject* PyBytes_FromFormat(const char *format, ...)
5252
5353
Take a C :c:func:`printf`\ -style *format* string and a variable number of
5454
arguments, calculate the size of the resulting Python bytes object and return
55-
a bytes object with the values formatted into it. The variable arguments
55+
a bytes object with the values formatted into it. The variable arguments
5656
must be C types and must correspond exactly to the format characters in the
57-
*format* string. The following format characters are allowed:
57+
*format* string. The following format characters are allowed:
5858
5959
.. % XXX: This should be exactly the same as the table in PyErr_Format.
6060
.. % One should just refer to the other.
@@ -136,12 +136,12 @@ called with a non-bytes parameter.
136136
137137
.. c:function:: char* PyBytes_AsString(PyObject *o)
138138
139-
Return a pointer to the contents of *o*. The pointer
139+
Return a pointer to the contents of *o*. The pointer
140140
refers to the internal buffer of *o*, which consists of ``len(o) + 1``
141-
bytes. The last byte in the buffer is always null, regardless of
142-
whether there are any other null bytes. The data must not be
141+
bytes. The last byte in the buffer is always null, regardless of
142+
whether there are any other null bytes. The data must not be
143143
modified in any way, unless the object was just created using
144-
``PyBytes_FromStringAndSize(NULL, size)``. It must not be deallocated. If
144+
``PyBytes_FromStringAndSize(NULL, size)``. It must not be deallocated. If
145145
*o* is not a bytes object at all, :c:func:`PyBytes_AsString` returns ``NULL``
146146
and raises :exc:`TypeError`.
147147
@@ -162,9 +162,9 @@ called with a non-bytes parameter.
162162
if it does, the function returns ``-1`` and a :exc:`ValueError` is raised.
163163
164164
The buffer refers to an internal buffer of *obj*, which includes an
165-
additional null byte at the end (not counted in *length*). The data
165+
additional null byte at the end (not counted in *length*). The data
166166
must not be modified in any way, unless the object was just created using
167-
``PyBytes_FromStringAndSize(NULL, size)``. It must not be deallocated. If
167+
``PyBytes_FromStringAndSize(NULL, size)``. It must not be deallocated. If
168168
*obj* is not a bytes object at all, :c:func:`PyBytes_AsStringAndSize`
169169
returns ``-1`` and raises :exc:`TypeError`.
170170
@@ -176,16 +176,16 @@ called with a non-bytes parameter.
176176
.. c:function:: void PyBytes_Concat(PyObject **bytes, PyObject *newpart)
177177
178178
Create a new bytes object in *\*bytes* containing the contents of *newpart*
179-
appended to *bytes*; the caller will own the new reference. The reference to
180-
the old value of *bytes* will be stolen. If the new object cannot be
179+
appended to *bytes*; the caller will own the new reference. The reference to
180+
the old value of *bytes* will be stolen. If the new object cannot be
181181
created, the old reference to *bytes* will still be discarded and the value
182182
of *\*bytes* will be set to ``NULL``; the appropriate exception will be set.
183183
184184
185185
.. c:function:: void PyBytes_ConcatAndDel(PyObject **bytes, PyObject *newpart)
186186
187187
Create a new bytes object in *\*bytes* containing the contents of *newpart*
188-
appended to *bytes*. This version releases the :term:`strong reference`
188+
appended to *bytes*. This version releases the :term:`strong reference`
189189
to *newpart* (i.e. decrements its reference count).
190190
191191
@@ -214,8 +214,8 @@ called with a non-bytes parameter.
214214
one, only more efficiently.
215215
Pass the address of an
216216
existing bytes object as an lvalue (it may be written into), and the new size
217-
desired. On success, *\*bytes* holds the resized bytes object and ``0`` is
218-
returned; the address in *\*bytes* may differ from its input value. If the
217+
desired. On success, *\*bytes* holds the resized bytes object and ``0`` is
218+
returned; the address in *\*bytes* may differ from its input value. If the
219219
reallocation fails, the original bytes object at *\*bytes* is deallocated,
220220
*\*bytes* is set to ``NULL``, :exc:`MemoryError` is set, and ``-1`` is
221221
returned.

Doc/c-api/call.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ please see individual documentation for details.
254254
.. c:function:: PyObject* PyObject_CallObject(PyObject *callable, PyObject *args)
255255
256256
Call a callable Python object *callable*, with arguments given by the
257-
tuple *args*. If no arguments are needed, then *args* can be *NULL*.
257+
tuple *args*. If no arguments are needed, then *args* can be *NULL*.
258258
259259
Return the result of the call on success, or raise an exception and return
260260
*NULL* on failure.
@@ -266,7 +266,7 @@ please see individual documentation for details.
266266
267267
Call a callable Python object *callable*, with a variable number of C arguments.
268268
The C arguments are described using a :c:func:`Py_BuildValue` style format
269-
string. The format can be *NULL*, indicating that no arguments are provided.
269+
string. The format can be *NULL*, indicating that no arguments are provided.
270270
271271
Return the result of the call on success, or raise an exception and return
272272
*NULL* on failure.
@@ -283,7 +283,7 @@ please see individual documentation for details.
283283
.. c:function:: PyObject* PyObject_CallMethod(PyObject *obj, const char *name, const char *format, ...)
284284
285285
Call the method named *name* of object *obj* with a variable number of C
286-
arguments. The C arguments are described by a :c:func:`Py_BuildValue` format
286+
arguments. The C arguments are described by a :c:func:`Py_BuildValue` format
287287
string that should produce a tuple.
288288
289289
The format can be *NULL*, indicating that no arguments are provided.
@@ -304,7 +304,7 @@ please see individual documentation for details.
304304
.. c:function:: PyObject* PyObject_CallFunctionObjArgs(PyObject *callable, ...)
305305
306306
Call a callable Python object *callable*, with a variable number of
307-
:c:expr:`PyObject *` arguments. The arguments are provided as a variable number
307+
:c:expr:`PyObject *` arguments. The arguments are provided as a variable number
308308
of parameters followed by *NULL*.
309309
310310
Return the result of the call on success, or raise an exception and return
@@ -317,8 +317,8 @@ please see individual documentation for details.
317317
.. c:function:: PyObject* PyObject_CallMethodObjArgs(PyObject *obj, PyObject *name, ...)
318318
319319
Call a method of the Python object *obj*, where the name of the method is given as a
320-
Python string object in *name*. It is called with a variable number of
321-
:c:expr:`PyObject *` arguments. The arguments are provided as a variable number
320+
Python string object in *name*. It is called with a variable number of
321+
:c:expr:`PyObject *` arguments. The arguments are provided as a variable number
322322
of parameters followed by *NULL*.
323323
324324
Return the result of the call on success, or raise an exception and return
@@ -400,5 +400,5 @@ Call Support API
400400
401401
.. c:function:: int PyCallable_Check(PyObject *o)
402402
403-
Determine if the object *o* is callable. Return ``1`` if the object is callable
404-
and ``0`` otherwise. This function always succeeds.
403+
Determine if the object *o* is callable. Return ``1`` if the object is callable
404+
and ``0`` otherwise. This function always succeeds.

Doc/c-api/init.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ Initializing and finalizing the interpreter
351351
triple: module; search; path
352352
single: Py_FinalizeEx (C function)
353353
354-
Initialize the Python interpreter. In an application embedding ython,
354+
Initialize the Python interpreter. In an application embedding Python,
355355
this should be called before using any other Python/C API functions; see
356356
:ref:`Before Python Initialization <pre-init-safe>` for the few exceptions.
357357

@@ -613,7 +613,7 @@ Process-wide parameters
613613
formed from the "official" name of the operating system, converted to lower
614614
case, followed by the major revision number; e.g., for Solaris 2.x, which is
615615
also known as SunOS 5.x, the value is ``'sunos5'``. On macOS, it is
616-
``'darwin'``. On Windows, it is ``'win'``. he returned string points into
616+
``'darwin'``. On Windows, it is ``'win'``. The returned string points into
617617
static storage; the caller should not modify its value. The value is available
618618
to Python code as ``sys.platform``.
619619

Doc/c-api/memory.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ API functions listed in this document.
4848

4949
To avoid memory corruption, extension writers should never try to operate on
5050
Python objects with the functions exported by the C library: :c:func:`malloc`,
51-
:c:func:`calloc`, :c:func:`realloc` and :c:func:`free`. This will result in ixed
51+
:c:func:`calloc`, :c:func:`realloc` and :c:func:`free`. This will result in mixed
5252
calls between the C allocator and the Python memory manager with fatal
5353
consequences, because they implement different algorithms and operate on
5454
different heaps. However, one may safely allocate and release memory blocks
@@ -267,14 +267,14 @@ The :ref:`default memory allocator <default-memory-allocators>` uses the
267267
268268
If *p* is ``NULL``, no operation is performed.
269269
270-
The following type-oriented macros are provided for convenience. Note hat
270+
The following type-oriented macros are provided for convenience. Note that
271271
*TYPE* refers to any C type.
272272
273273
274274
.. c:macro:: PyMem_New(TYPE, n)
275275
276276
Same as :c:func:`PyMem_Malloc`, but allocates ``(n * sizeof(TYPE))`` bytes of
277-
memory. Returns a pointer cast to ``TYPE*``. he memory will not have
277+
memory. Returns a pointer cast to ``TYPE*``. The memory will not have
278278
been initialized in any way.
279279
280280
@@ -417,7 +417,7 @@ Legend:
417417
* ``malloc``: system allocators from the standard C library, C functions:
418418
:c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` and :c:func:`free`.
419419
* ``pymalloc``: :ref:`pymalloc memory allocator <pymalloc>`.
420-
* ``mimalloc``: :ref:`mimalloc memory allocator <mimalloc>`. The pymalloc
420+
* ``mimalloc``: :ref:`mimalloc memory allocator <mimalloc>`. The pymalloc
421421
allocator will be used if mimalloc support isn't available.
422422
* "+ debug": with :ref:`debug hooks on the Python memory allocators
423423
<pymem-debug-hooks>`.
@@ -617,7 +617,7 @@ that the treatment of negative indices differs from a Python slice):
617617
default).
618618
619619
A serial number, incremented by 1 on each call to a malloc-like or
620-
realloc-like function. Big-endian :c:type:`size_t`. f "bad memory" is detected
620+
realloc-like function. Big-endian :c:type:`size_t`. If "bad memory" is detected
621621
later, the serial number gives an excellent way to set a breakpoint on the
622622
next run, to capture the instant at which this block was passed out. The
623623
static function bumpserialno() in obmalloc.c is the only place the serial
@@ -776,7 +776,7 @@ allocators operating on different heaps. ::
776776
...
777777
PyMem_Del(buf3); /* Wrong -- should be PyMem_Free() */
778778
free(buf2); /* Right -- allocated via malloc() */
779-
free(buf1); /* Fatal -- should be PyMem_Free() */
779+
free(buf1); /* Fatal -- should be PyMem_Free() */
780780
781781
In addition to the functions aimed at handling raw memory blocks from the Python
782782
heap, objects in Python are allocated and released with :c:macro:`PyObject_New`,

Doc/c-api/object.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Object Protocol
7979
8080
.. c:function:: int PyObject_Print(PyObject *o, FILE *fp, int flags)
8181
82-
Print an object *o*, on file *fp*. Returns ``-1`` on error. he flags argument
82+
Print an object *o*, on file *fp*. Returns ``-1`` on error. The flags argument
8383
is used to enable certain printing options. The only option currently supported
8484
is :c:macro:`Py_PRINT_RAW`; if given, the :func:`str` of the object is written
8585
instead of the :func:`repr`.

Doc/c-api/typeobj.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ Quick Reference
163163
164164
.. [#cols] Columns:
165165
166-
**"O"**: set on :c:data:`PyBaseObject_Type`
166+
**"O"**: set on :c:data:`PyBaseObject_Type`
167167
168-
**"T"**: set on :c:data:`PyType_Type`
168+
**"T"**: set on :c:data:`PyType_Type`
169169
170-
**"D"**: default (if slot is set to ``NULL``)
170+
**"D"**: default (if slot is set to ``NULL``)
171171
172172
.. code-block:: none
173173
@@ -177,7 +177,7 @@ Quick Reference
177177
178178
Also see the inheritance column ("I").
179179
180-
**"I"**: inheritance
180+
**"I"**: inheritance
181181
182182
.. code-block:: none
183183
@@ -2245,7 +2245,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
22452245

22462246
.. c:member:: void* PyTypeObject.tp_subclasses
22472247
2248-
A collection of subclasses. Internal use only. ay be an invalid pointer.
2248+
A collection of subclasses. Internal use only. May be an invalid pointer.
22492249

22502250
To get a list of subclasses, call the Python method
22512251
:py:meth:`~type.__subclasses__`.
@@ -2732,7 +2732,7 @@ Sequence Object Structures
27322732

27332733
Negative indexes are handled as follows: if the :c:member:`~PySequenceMethods.sq_length` slot is
27342734
filled, it is called and the sequence length is used to compute a positive
2735-
index which is passed to :c:member:`~PySequenceMethods.sq_item`. f :c:member:`!sq_length` is ``NULL``,
2735+
index which is passed to :c:member:`~PySequenceMethods.sq_item`. If :c:member:`!sq_length` is ``NULL``,
27362736
the index is passed as is to the function.
27372737

27382738
.. c:member:: ssizeobjargproc PySequenceMethods.sq_ass_item
@@ -2754,7 +2754,7 @@ Sequence Object Structures
27542754
.. c:member:: binaryfunc PySequenceMethods.sq_inplace_concat
27552755
27562756
This function is used by :c:func:`PySequence_InPlaceConcat` and has the same
2757-
signature. It should modify its first operand, and return it. his slot
2757+
signature. It should modify its first operand, and return it. This slot
27582758
may be left to ``NULL``, in this case :c:func:`!PySequence_InPlaceConcat`
27592759
will fall back to :c:func:`PySequence_Concat`. It is also used by the
27602760
augmented assignment ``+=``, after trying numeric in-place addition
@@ -2763,7 +2763,7 @@ Sequence Object Structures
27632763
.. c:member:: ssizeargfunc PySequenceMethods.sq_inplace_repeat
27642764
27652765
This function is used by :c:func:`PySequence_InPlaceRepeat` and has the same
2766-
signature. It should modify its first operand, and return it. his slot
2766+
signature. It should modify its first operand, and return it. This slot
27672767
may be left to ``NULL``, in this case :c:func:`!PySequence_InPlaceRepeat`
27682768
will fall back to :c:func:`PySequence_Repeat`. It is also used by the
27692769
augmented assignment ``*=``, after trying numeric in-place multiplication

0 commit comments

Comments
 (0)