summaryrefslogtreecommitdiffstats
path: root/Doc/extending
diff options
context:
space:
mode:
authorMartin Panter <vadmium>2015-08-25 05:06:39 (GMT)
committerMartin Panter <vadmium>2015-08-25 05:06:39 (GMT)
commit78d5033337d7fd270f8c1c7153ccf7be84b52048 (patch)
tree6b4e652c112a180a8dd9bcded20dda207020ff72 /Doc/extending
parentb372356d0a7e553c3d76bafe5fdcfc5312b3fc15 (diff)
downloadcpython-78d5033337d7fd270f8c1c7153ccf7be84b52048.zip
cpython-78d5033337d7fd270f8c1c7153ccf7be84b52048.tar.gz
cpython-78d5033337d7fd270f8c1c7153ccf7be84b52048.tar.bz2
Issue #24808: Update the documentation of some PyTypeObject fields
Patch by Joseph Weston.
Diffstat (limited to 'Doc/extending')
-rw-r--r--Doc/extending/newtypes.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/extending/newtypes.rst b/Doc/extending/newtypes.rst
index aaa37b8..0884430 100644
--- a/Doc/extending/newtypes.rst
+++ b/Doc/extending/newtypes.rst
@@ -893,20 +893,20 @@ fields in the right order! It's often easiest to find an example that includes
all the fields you need (even if they're initialized to ``0``) and then change
the values to suit your new type. ::
- char *tp_name; /* For printing */
+ const char *tp_name; /* For printing */
The name of the type - as mentioned in the last section, this will appear in
various places, almost entirely for diagnostic purposes. Try to choose something
that will be helpful in such a situation! ::
- int tp_basicsize, tp_itemsize; /* For allocation */
+ Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */
These fields tell the runtime how much memory to allocate when new objects of
this type are created. Python has some built-in support for variable length
structures (think: strings, lists) which is where the :c:member:`~PyTypeObject.tp_itemsize` field
comes in. This will be dealt with later. ::
- char *tp_doc;
+ const char *tp_doc;
Here you can put a string (or its address) that you want returned when the
Python script references ``obj.__doc__`` to retrieve the doc string.