summaryrefslogtreecommitdiffstats
path: root/Doc/api
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/api')
-rw-r--r--Doc/api/newtypes.tex8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/api/newtypes.tex b/Doc/api/newtypes.tex
index 8d862db..69c49f2 100644
--- a/Doc/api/newtypes.tex
+++ b/Doc/api/newtypes.tex
@@ -465,6 +465,14 @@ Foo_Type.ob_type = &PyType_Type;
has a non-zero \member{tp_itemsize}, it is generally not safe to set
\member{tp_itemsize} to a different non-zero value in a subtype
(though this depends on the implementation of the base type).
+
+ A note about alignment: if the variable items require a particular
+ alignment, this should be taken care of by the value of
+ \member{tp_basicsize}. Example: suppose a type implements an array
+ of \code{double}. \member{tp_itemsize} is \code{sizeof(double)}.
+ It is the programmer's responsibility that \member{tp_basicsize} is
+ a multiple of \code{sizeof(double)} (assuming this is the alignment
+ requirement for \code{double}).
\end{cmemberdesc}
\begin{cmemberdesc}{PyTypeObject}{destructor}{tp_dealloc}