Question from a "java background" developer

Dieter Maurer dieter at handshake.de
Tue Sep 22 13:25:02 EDT 2020


Chris Angelico wrote at 2020-9-22 19:25 +1000:
>On Tue, Sep 22, 2020 at 7:15 PM Agnese Camellini
><agnese.camellini at gmail.com> wrote:
>>
>> Hello to everyone, I have a question. I come from a Java background and I
>> would like to develop in python but i'm wondering: is there anything, in
>> python, like Java "reflection"?
>> I mean do i have a keyword to obtain all the methods and the attributes of
>> a class in python?
>
>Yes - introspection can be done by looking at a class's dictionary.
>Check out the dir() function to start exploring!

I find also `help(obj)` very helpful.

The basics behind `help` (a built in function) come from
the `inspect` module. It is very helpful to programmatically inspect
features of Python objects.


More information about the Python-list mailing list