Traverses the object name and returns the last (rightmost) python object.
(module: types.ModuleType, obj_name: str)
| 264 | |
| 265 | |
| 266 | def get_obj_from_module(module: types.ModuleType, obj_name: str) -> Any: |
| 267 | """Traverses the object name and returns the last (rightmost) python object.""" |
| 268 | if obj_name == '': |
| 269 | return module |
| 270 | obj = module |
| 271 | for part in obj_name.split("."): |
| 272 | obj = getattr(obj, part) |
| 273 | return obj |
| 274 | |
| 275 | |
| 276 | def get_obj_by_name(name: str) -> Any: |
no outgoing calls
no test coverage detected