One of Python's most interesting features is the power
of "introspection".
What is introspection? "In everyday life, introspection
is the act of self-examination... In computer
programming, introspection refers to the ability to
examine something to determine what it is, what it
knows, and what it is capable of doing." [1]
Why is that useful?
Say you have are importing a class, but you don't
remember its properties.
With introspection, you can just ask, and the class
will return a list all its properties and methods.
But there are many other questions that we could ask:
* What is your name?
* What kind of object are you?
* What do you know?
* What can you do?
* Who are your parents?
Reference:
[1]
http://www-106.ibm.com/developerworks/linux/library/l-pyint.html
Logged In: NO
I love this feature of python. Its great for documentation.
And maybe to add autocompletion to the gambas text editor.
Or showing params of the function you just typed in a small
box besides the cursor.
marvinh at mhome.de