Hi,
Another stumped beginner here.
I'm trying to have functions to create, edit and store dictionaries within a class. What I can't figure out is how to retain the edits after making them. I think it has something to do with namespace. Ideally I'd like to pickle class instances and be able to access each instance's unique dictionaries through a
classInst.dict arrangement. I don't know why I can't figure out how to make the dictionary an attribute of the class, or if that's even possible. Does the dict have to be a separate pickled file?
I've tried setting the dict in these namespaces:
class N:
dict = {}
class N:
def func(self):
dict = {}
but neither of these is working for me. If I make the dict global, then all class instances could edit it, which is not what I'm shooting for either. I'm out of ideas, and I sense that there is something basic that I either don't know or am overlooking.
Thanks in advance.
Luke
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor