AttributeError: How to list existing attributes?

Thomas Guettler guettli.usenet at thomas-guettler.de
Wed Sep 19 05:32:27 EDT 2007


Hi,

how can you list the attributes of an object if you catch an
AttributeError?

I couldn't find a reference in the exception object, which
points to the object.

I want to call dir() on the object to list the user the known
attributes.

Is there a way to find the object by inspecting the stacktrace?

 Thomas

-- 
Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/
E-Mail: guettli (*) thomas-guettler + de
Spam Catcher: niemand.leermann at thomas-guettler.de




More information about the Python-list mailing list