Reflection in Python: getattr
· β 2 min read
1. Application Scenarios Control the program’s runtime flow through a configuration file. What a configuration file usually holds is a string, not an object. When debugging a program, inspect all the attribute values of an object. Dynamic module import. For the first scenario, reflection is the widely adopted approach. Many