@@ -146,7 +146,7 @@ Then, create ``meson.build`` containing the following:
146146
147147.. code-block :: meson
148148
149- project('purelib-and-platlib ', 'c')
149+ project('sampleproject ', 'c')
150150
151151 py = import('python').find_installation(pure: false)
152152
@@ -309,9 +309,9 @@ To expose the ``system`` C function directly to Python,
309309we'll need to write a layer of glue code to convert arguments from Python
310310objects to C values, and the C return value back to Python.
311311
312- One of the simplest glue code is a ":c:data: `METH_O `" function,
312+ One of the simplest ways to write glue code is a ":c:data: `METH_O `" function,
313313which takes two Python objects and returns one.
314- All Pyton objects -- regardless of the Python type -- are represented in C
314+ All Python objects -- regardless of the Python type -- are represented in C
315315as pointers to the ``PyObject `` structure.
316316
317317Add such a function above the slots array::
@@ -322,7 +322,7 @@ Add such a function above the slots array::
322322 Py_RETURN_NONE;
323323 }
324324
325- For now, we'll ignor the arguments, and use the :c:macro: `Py_RETURN_NONE `
325+ For now, we'll ignore the arguments, and use the :c:macro: `Py_RETURN_NONE `
326326macro to properly ``return `` a Python :py:data: `None ` object.
327327
328328Recompile your extension to make sure you don't have syntax errors.
@@ -366,7 +366,7 @@ Add a :c:data:`Py_mod_methods` slot to your a :c:type:`PyMethodDef` array:
366366
367367Recompile your extension again, and test it.
368368Be sure to restart the Python interpreter, so that ``import spam `` picks
369- up the new version if the module.
369+ up the new version of the module.
370370
371371You should now be able to call the function:
372372
@@ -441,10 +441,10 @@ object.
441441This isn't useful in our case, so we'll ignore it.
442442
443443The other one, ``PyObject *arg ``, will be set to the object that the user
444- called the Python with .
444+ passed from Python.
445445We expect that it should be a Python string.
446446In order to use the information in it, we will need
447- to convert it to a C value --- in this case, a C string (``const char * ``).
447+ to convert it to a C value -- in this case, a C string (``const char * ``).
448448
449449There's a slight type mismatch here: Python's :py:class: `str ` objects store
450450Unicode text, but C strings are arrays of bytes.
0 commit comments