codello / Motor-ODM

A MongoDB ODM based on Motor and Pydantic.
MIT License
17 stars 5 forks source link

Remove Metaclass #13

Closed codello closed 4 years ago

codello commented 4 years ago

Motor-ODM currently uses a metaclass for its initialization mechanism. Following PEP 487 this mechanism should be implemented in __init_subclass__ instead, removing the need for a metaclass.

codello commented 4 years ago

__init_subclass__ is more of a notification on subclass creation. Customizing subclass behavior is better fittet in an actual meta class.