[issue12672] Some problems in documentation extending/newtypes.html
report at bugs.python.org
Tue Aug 16 04:45:06 CEST 2011
Eli Bendersky <eliben at gmail.com> added the comment:
Terry, I'm not 100% sure about what you mean by "Python wrapper objects ... visible from Python", but I think I'll disagree.
There's a big difference between "C functions" in general and "type methods" this document speaks of. Let's leave list aside for a moment, since its being built-in complicates matters a bit, and let's talk about the "Noddy" type this documentation page plays with.
You may implement "normal" methods for Noddy, such as the "name" method added in the first example, by defining an array of PyMethodDef structures and assigning it to tp_methods.
On the other hand, the other tp_ fields imlpement special type methods (used by __new__, __str__, getattr/setattr, and so on). This is the major difference. Both are C functions, but some implement special type methods and some implement "normal" object methods.
If this is also what you meant, I apologize for disagreeing :-)
I believe my latest rephrasing proposal is reflecting the above understanding.
P.S. as for s/that/than/ further down - good catch, will add it to the patch when we decide about the first issue
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list