Something like java's reflection???

James Kew james.kew at btinternet.com
Tue Aug 27 16:25:39 EDT 2002


"Frank Buss" <fb at frank-buss.de> wrote in message
news:akg9jv$ib1$3 at newsreader2.netcologne.de...
> "KC" <khcarlso at bellsouth.net> wrote:
>
> > I am curious if there is a way to get information at run time on an
> > objects internal attributes and methods -- something similar to java's
> > reflection api.  Is this possible in Python?
>
> Yes, you can use __dict__ on the class object and on instances.

Or use the inspect module, which provides more information than I'm
currently capable of understanding...

http://www.python.org/doc/current/lib/module-inspect.html

James






More information about the Python-list mailing list