Python: Python: Introspection function