Re: (newbie) class with a single instance ?!

2006-12-15 Thread Fredrik Lundh
Andrea Tomadin wrote: > I run a program which does some logging on files. I want to collect > all the filenames and handlers in the same structure. All the files > should be opened at startup, closed at exit, and easily accessed by > the rest of the script. open them at the module level, an

Re: (newbie) class with a single instance ?!

2006-12-15 Thread Kleine Aap
Andrea Tomadin wrote: > This works, but isn't it weird to define a class if I know from the > very beginning that there will be no more than an instance of that > class? Singleton http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52558 -- http://mail.python.org/mailman/listinfo/python-lis

(newbie) class with a single instance ?!

2006-12-15 Thread Andrea Tomadin
Hi, I need a suggestion on the better implementation for a very basic task. I run a program which does some logging on files. I want to collect all the filenames and handlers in the same structure. All the files should be opened at startup, closed at exit, and easily accessed by the rest of