[docs] [issue12672] Some problems in documentation extending/newtypes.html

Terry J. Reedy report at bugs.python.org
Mon Aug 15 02:21:28 CEST 2011


Terry J. Reedy <tjreedy at udel.edu> added the comment:

I agree that the sentence is a bit confusing and the 'object method' ambiguous. I suspect that the sentence was written years ago. In current Python, [].append is a bound method of class 'builtin_function_or_method'. I *suspect* that the intended contrast, and certainly the important one, is that between C functions, which get added to PyTypeObject structures, and their Python object wrappers that are visible from Python, but which must not be put in the type structure. The varieties of wrappers are irrelevant in this context and for the purpose of avoiding that mistake. So I would rewrite the sentence as:

These C functions are called “type methods” to distinguish them from Python wrapper objects, such as ``list.append`` or ``[].append``, visible in Python code.

Looking further down,
"Now if you go and look up the definition of PyTypeObject in object.h you’ll see that it has many more fields that the definition above.",
needs 'that' changed to 'than' and I would insert " following tp_doc" after 'fields'.

----------
nosy: +terry.reedy

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


More information about the docs mailing list