P
Philippe C. Martin
This is a basic question I'm sure but I do not know wether to use __builtin__,
global, or a static method:
I have a very large XML file that I load into dictionnaries defined in a class
located in a module that is imported in many places.
Since the loading process is very slow, I would like the file not to be loaded
on import or class instantiation, but only once (on first import or class
instantiation).
Currently I have the loading code in the class __init__.
Is there a clean way to do this (I'd like to avoid global)?
Regards,
Philippe
--
*********************
Philippe C. Martin
SnakeCard LLC
www.snakecard.com
*********************
global, or a static method:
I have a very large XML file that I load into dictionnaries defined in a class
located in a module that is imported in many places.
Since the loading process is very slow, I would like the file not to be loaded
on import or class instantiation, but only once (on first import or class
instantiation).
Currently I have the loading code in the class __init__.
Is there a clean way to do this (I'd like to avoid global)?
Regards,
Philippe
--
*********************
Philippe C. Martin
SnakeCard LLC
www.snakecard.com
*********************