STINNER Victor <vstin...@python.org> added the comment:
I checked " Types converted pre Python 3.9" and "Types converted in Python 3.9" of: https://discuss.python.org/t/list-of-built-in-types-converted-to-heap-types/8403 (I didn't check "Types converted in Python 3.10" yet.) These lists are not complete, for example select.kevent was not listed whereas it has a bug. _struct.unpack_iterator can be modified to use Py_TPFLAGS_DISALLOW_INSTANTIATION: its tp_new method always raises an exception. Bugs! * select.kevent: BUG, use {Py_tp_new, PyType_GenericNew} slot which doesn't properly initialize kqueue_event_Object! Need review: * _ast.AST: use {Py_tp_new, PyType_GenericNew} and {Py_tp_init, ast_type_init} slots. What happens if tp_new is called without calling tp_init? Implement tp_new (ok!): * _abc._abc_data * _json.Scanner * _json.Encoder * select.devpoll * select.epoll * select.kqueue * _random.Random * _struct.Struct Other cases (ok!): * _ssl.SSLError inherits from OSError and reuses OSError structure (PyOSErrorObject): the inherited tp_new works as expected. * select.poll: Py_TPFLAGS_DISALLOW_INSTANTIATION ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue43916> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com