Bug report
Bug description:
# `metaclass_instance == np.dtype` for NumPy main
type("name", metaclass_instance, {})
for metaclasses that have tp_new == NULL is well defined: It has to be a Python error just like:
>>> type(metaclass_instace)()
TypeError: cannot create 'numpy._DTypeMeta' instances
(in this case a NumPy metaclass, but you need the main branch of NumPy to test this.)
That is, a metaclass that is a valid baseclass in C but has tp_new == NULL cannot be instantiated from Python but hits this code branch:
|
*type = winner->tp_new(winner, ctx->args, ctx->kwds); |
Which clearly segfaults for tp_new == NULL.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
Bug report
Bug description:
for metaclasses that have
tp_new == NULLis well defined: It has to be a Python error just like:(in this case a NumPy metaclass, but you need the main branch of NumPy to test this.)
That is, a metaclass that is a valid baseclass in C but has
tp_new == NULLcannot be instantiated from Python but hits this code branch:cpython/Objects/typeobject.c
Line 5029 in 94a64bb
Which clearly segfaults for
tp_new == NULL.CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
type()with NULLtp_newmetaclasses #151916