Python Introspection: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 9: Line 9:
<code>[[Python Language Functions#getattr|getattr()]]</code> is a built-in function that returns the value of the specified attribute from the specified object.
<code>[[Python Language Functions#getattr|getattr()]]</code> is a built-in function that returns the value of the specified attribute from the specified object.


=The <tt>inspect</tt> Package=
=The <tt>inspect</tt> Standard Library Module=


=Module Introspection=
=Module Introspection=

Revision as of 18:34, 8 July 2022

Internal

TODO

https://www.geeksforgeeks.org/code-introspection-in-python/

Overview

Introspection is Python's equivalent for Java reflection. It is the ability to determine the type of an object at runtime and to dynamically examine Python objects.

getattr()

getattr() is a built-in function that returns the value of the specified attribute from the specified object.

The inspect Standard Library Module

Module Introspection

Also see:

Python Language Modularization

Class Instance Introspection

Invoking a Static Method Dynamically