Declaring a metaclass in Rust requires to extend PyType and to adapt the default new implementation (since a metaclass should always allow to create a class in Python).
This would allow for efficient implementation of __instancecheck__ and __subclasscheck__. It would also allow to keep track of information about created classes in Rust instead of storing them as standard attributes on the class which can be modified later.
I am fine doing the changes. I am however open to suggestions as to where to document this.
Specifying a metaclass when defining a class in Rust is out of scope.
Declaring a metaclass in Rust requires to extend PyType and to adapt the default new implementation (since a metaclass should always allow to create a class in Python).
This would allow for efficient implementation of
__instancecheck__and__subclasscheck__. It would also allow to keep track of information about created classes in Rust instead of storing them as standard attributes on the class which can be modified later.I am fine doing the changes. I am however open to suggestions as to where to document this.
Specifying a metaclass when defining a class in Rust is out of scope.