A
Andrew Fabbro
This is probably a beginner's question, but I'm stuck...please be kind
to an ex-perler
How do I do something like this:
for attr in dir(some_obj):
if ( some_obj.attr == 0 ):
print "Missing data: %s field %s" % ( some_obj.name,
some_obj.attr)
Of course, this gives
"AttributeError: foo instance has no attribute 'attr'"
I really don't want to use exec/eval, as that slows things down
dramatically.
Help?
Thanks.
-Drew
to an ex-perler
How do I do something like this:
for attr in dir(some_obj):
if ( some_obj.attr == 0 ):
print "Missing data: %s field %s" % ( some_obj.name,
some_obj.attr)
Of course, this gives
"AttributeError: foo instance has no attribute 'attr'"
I really don't want to use exec/eval, as that slows things down
dramatically.
Help?
Thanks.
-Drew