Python Introspection: Difference between revisions

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


=Module Introspection=
=Module Introspection=

Revision as of 18:31, 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.

Module Introspection

Also see:

Python Language Modularization

Class Instance Introspection

Invoking a Static Method Dynamically