[Tutor] Object attributes surviving deletion
Shrutarshi Basu
technorapture at gmail.com
Fri Jun 27 01:13:43 CEST 2008
It turns out that Alan's catch of the instance vs class variables was
right. database was declared in the class body, rather than in the
__init__. Doing gram.database = {}, may have replaced it.. But I've
changed the Grammars class to have the proper instance variables.
Apparently my teammates and I were still thinking Java-style object
models, rather than Pythonic. That's a lesson well learned.
@Jeff: We thought of that the first time and so DisplayModule makes
deepcopies of them instead of just references.
@Alan: Thanks for the point about the naming convention. We're writing
our system to be more flexible and object-oriented, so we'll be making
a lot of these decisions. We've all realized that we have some rather
bad naming conventions.
Thanks again to all of you.
--
The ByteBaker :
http://www.bytebaker.com
More information about the Tutor
mailing list