Snippet to get all local classes from a module
I have already used similar code and it looks rather fine. Some nitpicks:


I’d name the variable cls to mimic the name often used as first parameters of @classmethods; or class_ as it is more common;
I’d store a list of classes intead of a list of names, this feels more directly usable (and names are still stored as cls.__name__ if need be);
sys.modules[__name__].__name__ should be just __name__.




Alternatively, since these classes seems related to each other, you may have an inheritance tree; or maybe a common base class. In this case, you could be even more specific using something such as:

[cls for _, cls in inspect.getmembers(my_module, inspect.isclass) if issubclass(cls, my_module.CommonBase)]


or

my_module.CommonBase.__subclasses__()


if there really is a single level of inheritance, but I wouldn't count much on it as it can break so easily.