[issue20224] C API docs need a clear "defining custom extension types" section

Nick Coghlan report at bugs.python.org
Sun Jan 12 07:25:11 CET 2014


New submission from Nick Coghlan:

The main C API docs don't clearly explain how to define new types, so people almost always cargo cult an existing legacy type definition instead (I know I do).

The extending and embedding docs have a guide (http://docs.python.org/3/extending/newtypes.html), but that describes the old legacy method based on static type declarations. New code should instead use the dynamic mechanism defined in PEP 384 (http://www.python.org/dev/peps/pep-0384/#type-objects).

See also http://docs.python.org/3/c-api/type.html#PyType_FromSpec

Note that PyType_Spec isn't defined in the C API docs *at all*.

----------
assignee: docs at python
components: Documentation
messages: 207927
nosy: docs at python, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: C API docs need a clear "defining custom extension types" section
type: enhancement
versions: Python 3.3, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20224>
_______________________________________


More information about the Python-bugs-list mailing list