Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I found Python OO to be a super elegant and practical way to implement a common API for multiple databases.


One doesn't need OO for that tho, the module system applies just as well to solving that problem.


Module 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=...)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: