[docs] bug in documentation: https://docs.python.org/3.5/extending/newtypes.html

Willem de Jong wjong at alten.nl
Thu Dec 24 06:10:01 EST 2015


 Hi,

I found a bug in the documentation of python 3.5.
https://docs.python.org/3.5/extending/newtypes.html
In the example in paragraph 
2.1.2. Providing finer control over data attributes
function: Noddy_init(Noddy *self, PyObject *args, PyObject *kwds) 

contains two issues:


1) The PyArg_ParseTupleAndKeywords containst a wrong format specifier : "|SSi" should be  "|ssi"
the captial S would expect an byte, while lowercase 's' represents a string.

2)
When calling the Name function, it will crash, because I think the ParseTupleAndKeywords function in the init will store a string in first.

Best regards,

Willem de Jong.
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20151224/94dd62a7/attachment-0001.html>


More information about the docs mailing list