Mar 29, 2024
Fun article, accept claps, but I have to quibble about two things!
First, this technique is used all the time when you are dynamically loading a package whose name is kept in a string. This is extremely useful for, for example, plug-ins to your module.
Second, using __import__
directly is not a good idea. You should be using importlib
instead, as it's more full-featured.