4 ms·
I found Python OO to be a super elegant and practical way to implement a common API for multiple databases.
by andrewstuart 6y ago
I found Python OO to be a super elegant and practical way to implement a common API for multiple databases.
- nerpderp82 6y agoOne doesn't need OO for that tho, the module system applies just as well to solving that problem.
- snidane 6y agoModule corresponds to a class, not to an object. Afaik, you can't instantiate a module in python multiple times with different parameters. In theory you would like to do this, but it is not supported in python, therefore you would use classes as poor man's modules. conn = import Database(host=..., user=...)