pyo3 icon indicating copy to clipboard operation
pyo3 copied to clipboard

Use disallow instantiation flag for classes without the __new__ method

Open ahlinc opened this issue 5 months ago • 0 comments

Starting from Py 3.10 it's possible to prohibit instantiation by using Py_TPFLAGS_DISALLOW_INSTANTIATION flag instead of using a stub method. From the Python side it makes it clear if there is no __new__ attr on a class then it can't be instantiated.

ahlinc avatar Sep 19 '24 12:09 ahlinc