developerWorks: Guide to Python Introspection
Dec 23, 2002, 08:30 (1 Talkback[s])
(Other stories by Patrick K. O'Brien)
How to Help Your Business Become an AI Early Adopter
"In everyday life, introspection is the act of self-examination.
Introspection refers to the examination of one's own thoughts,
feelings, motivations, and actions. The great philosopher Socrates
spent much of his life in self-examination, encouraging his fellow
Athenians to do the same. He even claimed that, for him, 'the
unexamined life is not worth living...'
"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. Introspection gives programmers a great
deal of flexibility and control. Once you've worked with a
programming language that supports introspection, you may similarly
feel that "the unexamined object is not worth instantiating."
"This article introduces the introspection capabilities of the
Python programming language. Python's support for introspection
runs deep and wide throughout the language. In fact, it would be
hard to imagine Python without its introspection features. By the
end of this article you should be very comfortable poking inside
the hearts and souls of your own Python objects..."