How would I extend the sqlite3 module so if I import Database I can do Database.connect() as an alias to sqlite3.connect(), but define extra non standard methods?
-
3Why do you need that? Python is dynamic, so you can add extra functions and methods and whatnot to modules, but that does not mean that that is a good idea. Create your own module for that code instead.Martijn Pieters– Martijn Pieters2012-12-14 15:25:50 +00:00Commented Dec 14, 2012 at 15:25
-
End users are sometimes not the brightest of people, so having a module which is an alias to the built in stuff but also with all the extra functionality I require would be an ideal situation.illumi– illumi2012-12-14 15:50:13 +00:00Commented Dec 14, 2012 at 15:50
Add a comment
|