Is it ok to call PyBaseType_Object.tp_new from external code?
Oct. 3, 2017
3:04 p.m.
Hi, I've noticed that when calling PyBaseObject_Type.tp_new ( https://github.com/python/cpython/blob/master/Objects/typeobject.c#L3608), function excess_args is immediately called which assumes its first parameter is a tuple. Problem is that tuple struct is bigger that Py_None, correct me if I'm wrong. I've noticed code in swig which calls object_new with both args and kwds being Py_None and reported an issue for it (https://github.com/swig/swig/issues/1109). The question is whether it's ok to call tp_new on a given PyTypeObject but the second and third param should always be a tuple and a dict or should some other api function be called instead? Thanks, Łukasz
2666
Age (days ago)
2666
Last active (days ago)
0 comments
1 participants
participants (1)
-
Łukasz Jagielski