Skip to content

Instantly share code, notes, and snippets.

@schlerp
Created May 25, 2021 23:34
Show Gist options
  • Save schlerp/5a61255d65e3e107510b1c08a4dc8a35 to your computer and use it in GitHub Desktop.
Save schlerp/5a61255d65e3e107510b1c08a4dc8a35 to your computer and use it in GitHub Desktop.
def get_classes_from_module(module: ModuleType) -> Iterator[Any]:
for _, obj in inspect.getmembers(module):
if inspect.isclass(obj):
yield obj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment