[issue29165] Use forward compatible macro in example code for creating new type

2017-02-21 Thread INADA Naoki
INADA Naoki added the comment: > And it seems to me that Doc/includes/shoddy.c in Python 3 is not correct. I created another pull request PR 215. -- ___ Python tracker

[issue29165] Use forward compatible macro in example code for creating new type

2017-02-21 Thread INADA Naoki
Changes by INADA Naoki : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue29165] Use forward compatible macro in example code for creating new type

2017-02-21 Thread INADA Naoki
INADA Naoki added the comment: New changeset 9436bbd87b7eed18dec4c32f25b88452fe282e1c by GitHub in branch '2.7': bpo-29165: doc: make extending/newtypes more Python 3 friendly (GH-211) https://github.com/python/cpython/commit/9436bbd87b7eed18dec4c32f25b88452fe282e1c --

[issue29165] Use forward compatible macro in example code for creating new type

2017-02-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ah, now I see. I think sample C files in Doc/includes/ should be updated too. And it seems to me that Doc/includes/shoddy.c in Python 3 is not correct. -- ___ Python tracker

[issue29165] Use forward compatible macro in example code for creating new type

2017-02-21 Thread INADA Naoki
INADA Naoki added the comment: > but the code with PyObject_HEAD_INIT() doesn't look incompatible with Python > 3. It's incompatible actually. https://github.com/python/cpython/blob/2.7/Include/object.h /* PyObject_HEAD defines the initial segment of every PyObject. */ #define

[issue29165] Use forward compatible macro in example code for creating new type

2017-02-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PyVarObject_HEAD_INIT() is more used in Python 3 code, but the code with PyObject_HEAD_INIT() doesn't look incompatible with Python 3. I don't see a need of this change. PyObject_HEAD_INIT() also is used in .c files in Doc/includes/. -- nosy:

[issue29165] Use forward compatible macro in example code for creating new type

2017-02-20 Thread INADA Naoki
Changes by INADA Naoki : -- pull_requests: +179 ___ Python tracker ___ ___

[issue29165] Use forward compatible macro in example code for creating new type

2017-01-04 Thread INADA Naoki
New submission from INADA Naoki: https://docs.python.org/2.7/extending/newtypes.html#the-basics uses PyObject_HEAD_INIT for type object header. static PyTypeObject noddy_NoddyType = { PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ This code isn't compatible with