pyo3 icon indicating copy to clipboard operation
pyo3 copied to clipboard

Add way to set metaclass for #[pyclass]

Open programmerjake opened this issue 5 years ago • 4 comments

apparently it works by setting the ob_type member to a custom instance (the metaclass) of a class that derives from type.

programmerjake avatar May 06 '20 06:05 programmerjake

Has there been progress on this issue? I'm looking for a way of implementing a custom instancecheck for a pyclass.

lausek avatar Sep 22 '20 15:09 lausek

Any progress would have been on this issue! A proposal of how the API should look and / or a PR to implement this is always welcome 😄

davidhewitt avatar Sep 23 '20 06:09 davidhewitt

Someone mentioned this issue on Gitter. https://bugs.python.org/issue15870

It seems that metaclass is not officially supported in C extensions.

jovenlin0527 avatar Nov 21 '21 11:11 jovenlin0527