I have a module in my code called a.py
which looks a bit like this:
import sqlite3
from sqlite3 import *
"""The point of importing twice in a different way is to
have a.py imported by someone and have all the sqlite3 functions (with some overriden by a.py)
but a.py still needs access to the source sqlite3 functions that he overrides"""
def connect(database): #overriding sqlite3's connect()
print "It worked!"
return sqlite3.connect(database)
and a file called b.py
:
import a
a.sqlite3.connect("data.db")
I want to make the code in b.py
invalid as no one should be able access the original (non-overriden) functions through a.py
, how can I do this?