Extension pattern in a flask controller using importlib 2.0
Can you give me your opinion on this piece of code ? Is it "pythonic" ?


I don't really see anything non-pythonic about it.
Some minor coding style issues though:


Minor PEP8 violations:


put 2 blank lines before class and top-level function definitions
use snake_case for function names instead of camelCase

Unnecessary parentheses in if (endpoint_name in self._endpoints_classes):


A bigger issue I see is that the module loading is convoluted and fragile:


HandlerCollection.getClass tries to import a module : violates the single responsibility principle, it would be better to move this logic somewhere else
The imported module is expected to have a register function : a semantic rule, not obvious enough from the code itself. There are no docstrings either, so as it is, implementors have to dig this piece of information out of the current implementation details
The register function must pass a class that has a name property defined : semantic rule, see the previous item
The logical flow of HandlerCollection.getClass is convoluted:


try to import module if missing
pass self to module.register
module.register calls me.addClass


I suggest to move the module loading part out to a different method, perhaps HandlerRegistry.load_and_register_if_missing, and let getClass behave as a simple cache.