diff options
author | Martin Panter <vadmium> | 2015-08-25 05:25:21 (GMT) |
---|---|---|
committer | Martin Panter <vadmium> | 2015-08-25 05:25:21 (GMT) |
commit | 36f22a2820d4e2dc31720e90ccc14050838081ad (patch) | |
tree | da067dcaeacbd14ce64ad872ed02cf465e6d235f /Doc/extending | |
parent | ef4554f71653ff90a84d9071a7643cc3edcc616f (diff) | |
parent | 78d5033337d7fd270f8c1c7153ccf7be84b52048 (diff) | |
download | cpython-36f22a2820d4e2dc31720e90ccc14050838081ad.zip cpython-36f22a2820d4e2dc31720e90ccc14050838081ad.tar.gz cpython-36f22a2820d4e2dc31720e90ccc14050838081ad.tar.bz2 |
Issue #24808: Merge 3.4 into 3.5; adjust new tp_as_async field
Diffstat (limited to 'Doc/extending')
-rw-r--r-- | Doc/extending/newtypes.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/extending/newtypes.rst b/Doc/extending/newtypes.rst index b7e35f4..f60e208 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. |