Skip to content

Commit 1db9be2

Browse files
encukouhugovk
andauthored
Apply suggestions from code review
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent 8a2e5aa commit 1db9be2

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

peps/pep-0793.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ To make this viable, we also specify new module slot types to replace
2727
We also add an API for defining modules from slots dynamically.
2828

2929
The existing API (``PyInit_*``) is soft-deprecated.
30-
(That is: it will continue to work without warnings, and it'll fe fully
30+
(That is: it will continue to work without warnings, and it'll be fully
3131
documented and supported, but we plan to not add any new features to it.)
3232

3333

@@ -289,7 +289,7 @@ If specified, using a new ``Py_mod_token`` slot, the module token must:
289289

290290
(Typically, it should point to a static constant.)
291291

292-
When the address of a ``PyModuleDef`` is used as as a module's token,
292+
When the address of a ``PyModuleDef`` is used as a module's token,
293293
the module should behave as if it was created from that ``PyModuleDef``.
294294
In particular, the module state must have matching layout and semantics.
295295

@@ -429,7 +429,7 @@ module, so this should not be considered a breaking change.
429429

430430
Similarly, the ``PyType_GetModuleByDef`` function may stop matching modules
431431
whose definition changed. Module authors may avoid this by explicitly
432-
explicitly setting a *def* as the *token*.
432+
setting a *def* as the *token*.
433433

434434
``PyType_GetModuleByDef`` will now accept a module token as the *def* argument.
435435
We specify a suitable restriction on using ``PyModuleDef`` addresses as tokens,
@@ -478,13 +478,13 @@ wrappers, the :ref:`pep793-shim` below may be more useful.
478478
``PyModuleDef`` structure.
479479

480480
#. Optionally, scan your code for uses of ``PyType_GetModuleByDef``,
481-
and replace them by ``PyType_GetModuleByToken``.
481+
and replace them with ``PyType_GetModuleByToken``.
482482
Later in this guide, you'll set the token to *be* the existing
483483
``PyModuleDef`` structure.
484484

485485
(You may skip this step if targetting Python versions that don't expose
486486
``PyType_GetModuleByToken``, since ``PyType_GetModuleByDef`` is
487-
backwards-compatible. )
487+
backwards-compatible.)
488488

489489
#. Look at the function identified by ``Py_mod_create``, if any.
490490
Make sure that it does not use its second argument (``PyModuleDef``),
@@ -550,7 +550,7 @@ Once your module no longer supports lower versions:
550550

551551
#. If the existing ``PyModuleDef`` struct is used *only* for ``Py_mod_token``
552552
and/or ``PyType_GetModuleByToken``, you may remove the ``Py_mod_token``
553-
line and replace ``&your_module_def`` by ``module_slots`` everywhere else.
553+
line and replace ``&your_module_def`` with ``module_slots`` everywhere else.
554554

555555
#. Delete any unused data.
556556
The ``PyModuleDef`` struct and the original slots array are likely to be
@@ -562,7 +562,7 @@ Once your module no longer supports lower versions:
562562
Backwards compatibility shim
563563
----------------------------
564564

565-
It is possible to write generic function that implements the “old” export
565+
It is possible to write a generic function that implements the “old” export
566566
hook (``PyInit_``) in terms of the API proposed here.
567567

568568
The following implementation can be copied and pasted to a project; only the
@@ -589,7 +589,7 @@ This implementation places a few additional requirements on the slots array:
589589
- Any ``Py_mod_token`` must be set to ``&module_def_and_token``, defined here.
590590

591591
It also passes ``NULL`` as *spec* to the ``PyModExport`` export hook.
592-
A proper implementation would pass ``None`` instead, .
592+
A proper implementation would pass ``None`` instead.
593593

594594
.. literalinclude:: pep-0793/shim.c
595595
:language: c
@@ -653,7 +653,6 @@ Possible Future Directions
653653

654654
These ideas are out of scope for *this* proposal.
655655

656-
657656
Improving slots in general
658657
--------------------------
659658

0 commit comments

Comments
 (0)