How to create a factory function that preserves generic type information in Python?
I have the following function that returns a class with a generic type parameter:
How to create a factory function that preserves generic type information in Python?
I have the following function that returns a class with a generic type parameter:
How to create a generic type bound by another generic type and an “interface”?
I want to write a typed BaseCollection
class for a database layer, which I then plan to subclass for specific collections, e.g., for UserCollection
. The goal is to a) have a standardized interface and to implement generic methods such as get() which can be used for all collections.