Python Introspection: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 11: Line 11:
=The <tt>inspect</tt> Standard Library Module=
=The <tt>inspect</tt> Standard Library Module=
{{External|https://docs.python.org/3/library/inspect.html#module-inspect}}
{{External|https://docs.python.org/3/library/inspect.html#module-inspect}}
<code>[[#Python_Language#inspect|inspect]]</code> is a Standard Library module.


=Module Introspection=
=Module Introspection=

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

https://docs.python.org/3/library/inspect.html#module-inspect

inspect is a Standard Library module.

Module Introspection

Also see:

Python Language Modularization

Class Instance Introspection

Invoking a Static Method Dynamically