I'm using this line to get all classes used in a script:
clsmembers = inspect.getmembers(sys.modules[__name__], inspect.isclass)
Is there a (common) way to filter out all classes but those which were created within the script? (I don't want the names of the classes which were imported.)
Simply looping over all elements and checking for __main__ is imho too ugly.