Bounding ModelT to ModelProtocol makes it difficult to implement SQLAlchemy ORM imperative mapping and use this library Repositories together.
According to Clean Architecture, domain layer (where mapped classes would be) should not depend on any third party libraries.
I think it's unnecessary to have this bound, cuz it's limit's us in terms of mapping to a declarative one. (We can use imperative one, but only by inheriting mapped model from ModelProtocol)
Basic Example
IDK how to change things without breaking typings. 'to_dict' is ok and 'name: str' too.
but how neccessery is this typings?
Summary
Bounding ModelT to ModelProtocol makes it difficult to implement SQLAlchemy ORM imperative mapping and use this library Repositories together.
According to Clean Architecture, domain layer (where mapped classes would be) should not depend on any third party libraries.
I think it's unnecessary to have this bound, cuz it's limit's us in terms of mapping to a declarative one. (We can use imperative one, but only by inheriting mapped model from ModelProtocol)
Basic Example
IDK how to change things without breaking typings. 'to_dict' is ok and 'name: str' too. but how neccessery is this typings?
Drawbacks and Impact
typings would be affected