hai shi <shihai1...@126.com> added the comment:

>This code could be made much safer if there were a 
>PyType_FromSpecWithBasesMeta which used the meta class to allocate the memory

IMHO, `PyType_FromSpecWithBases` is a atomic API of `TypeObject`.
Adding a class as a param will result in `PyType_FromSpecWithBases` will be 
complicated(the logic of this function depends on the children's tp_alloc 
sometimes).

I add pter in this bpo, maybe he have some better ideas :)

----------
nosy: +petr.viktorin, shihai1991
versions: +Python 3.10

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42617>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to