On Sep 19, 4:03 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > exhuma.twn wrote: > > On Sep 19, 3:45 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > >> exhuma.twn wrote: > > [...] > > >> By the way, there is a pythonic (near) singleton: the module. So if you go > >> with option 2, just move the connection setup into a separate module that > >> you can import into client code. > > >> Peter > > > You say "(near)" singleton. What's the difference then? > > I was thinking of the main script of an application. If you import > that by its name > > import main # assuming the file is main.py > > you end up with two instances sys.modules["main"] and sys.modules["__main__"]. > > Peter
I see. Thanks. I will give it a go. -- http://mail.python.org/mailman/listinfo/python-list