general class functions

syd syd.diamond at
Fri Nov 26 07:06:28 CET 2004

> Not without seeing some code. Show us your Container class and one of
> the callers.

Well, huh.  I started to put an example minimal piece of code together,
and I could not reproduce the problem.  An hour of taking things out of
my current code one by one until it worked made me realize my error.

Right now, I check for attribute validity using a getBlankItem() that
uses a string specific to that Container instance and the globals()
directory .  When the general Container class is imported, the
globals() in the Container.getBlankItem() will no longer find the class
that the string refers to.  And unfortunately, the way I had it set up,
it did not give an error there, so I had a hard time tracking that

I guess the lesson is that globals() in an imported class is not the
same as globals() in the main file.

More information about the Python-list mailing list