diff options
author | Georg Brandl <georg@python.org> | 2009-01-03 21:04:55 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-01-03 21:04:55 (GMT) |
commit | 7044b11818cb81d1df0573b3cfe8d9b90befce9b (patch) | |
tree | 0197d5c9c583b486559a4258e6719984629e9dcd /Doc/extending | |
parent | c62ef8b4d9648c36218cb0142a6395a00c11885e (diff) | |
download | cpython-7044b11818cb81d1df0573b3cfe8d9b90befce9b.zip cpython-7044b11818cb81d1df0573b3cfe8d9b90befce9b.tar.gz cpython-7044b11818cb81d1df0573b3cfe8d9b90befce9b.tar.bz2 |
Remove tabs from the documentation.
Diffstat (limited to 'Doc/extending')
-rw-r--r-- | Doc/extending/newtypes.rst | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Doc/extending/newtypes.rst b/Doc/extending/newtypes.rst index 3f9054b..030de57 100644 --- a/Doc/extending/newtypes.rst +++ b/Doc/extending/newtypes.rst @@ -840,8 +840,8 @@ As you can see, the source code closely resembles the :class:`Noddy` examples in previous sections. We will break down the main differences between them. :: typedef struct { - PyListObject list; - int state; + PyListObject list; + int state; } Shoddy; The primary difference for derived type objects is that the base type's object @@ -854,10 +854,10 @@ be safely cast to both *PyListObject\** and *Shoddy\**. :: static int Shoddy_init(Shoddy *self, PyObject *args, PyObject *kwds) { - if (PyList_Type.tp_init((PyObject *)self, args, kwds) < 0) - return -1; - self->state = 0; - return 0; + if (PyList_Type.tp_init((PyObject *)self, args, kwds) < 0) + return -1; + self->state = 0; + return 0; } In the :attr:`__init__` method for our type, we can see how to call through to @@ -876,18 +876,18 @@ the module's :cfunc:`init` function. :: PyMODINIT_FUNC initshoddy(void) { - PyObject *m; + PyObject *m; - ShoddyType.tp_base = &PyList_Type; - if (PyType_Ready(&ShoddyType) < 0) - return; + ShoddyType.tp_base = &PyList_Type; + if (PyType_Ready(&ShoddyType) < 0) + return; - m = Py_InitModule3("shoddy", NULL, "Shoddy module"); - if (m == NULL) - return; + m = Py_InitModule3("shoddy", NULL, "Shoddy module"); + if (m == NULL) + return; - Py_INCREF(&ShoddyType); - PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType); + Py_INCREF(&ShoddyType); + PyModule_AddObject(m, "Shoddy", (PyObject *) &ShoddyType); } Before calling :cfunc:`PyType_Ready`, the type structure must have the @@ -1167,7 +1167,7 @@ structure:: typedef struct PyMethodDef { char *ml_name; /* method name */ PyCFunction ml_meth; /* implementation function */ - int ml_flags; /* flags */ + int ml_flags; /* flags */ char *ml_doc; /* docstring */ } PyMethodDef; |