Loading a file only once into an object and being able to access it from other modules - still have a problem
Philippe C. Martin
philippecmartin at sbcglobal.net
Thu Dec 9 13:12:30 EST 2004
>Well, from the looks of things, you don't seem to understand the
>basic idea of instances and instance attributes. There is a key
>difference between SC_ISO_67816.__m_loaded and self.SW1_DICT,
>and that is that the former one is seen by *all instances*, while
>the latter is an attribute in *only a single instance*.
Sorry for the tabs !
Indeed I had not grasped the concept has from my many years in C++, I would
have had to use a private constructor + a static create method to keep users
from instanciating more than one object.
You are correct, my __Load method "loads" self.DICTIONNARIES.
So now my understanding is that __Load needs to load
SC_ISO_7816.DICTIONNARIES, and children classes will have to refer to
SC_ISO_7816.DICTIONNARIES if they want to see something.
I'll give it a shot right now.
Thank you!
Philippe
--
*********************
Philippe C. Martin
SnakeCard LLC
www.snakecard.com
*********************
More information about the Python-list
mailing list