How to approach this?

Dale Strickland-Clark dale at out-think.NOSPAM.co.uk
Sun Jul 9 15:51:20 EDT 2000


I'm still getting to grips with Python so this may sound basic:

I have one class which handles a database connection and a number of other
clasess which need that connection.

I want there to be just one instance of the database class which is created
as soon as it's needed by a dependant class.

There could be any number of instances of the dependant classes appearing
and disappearing during a run.

How do I make sure that the database object is properly closed when there
are no instances of the dependant classes left?

Thanks for any help.

Dale Strickland-Clark






More information about the Python-list mailing list