Hi folks,
It looks that there's one issue of Python where dynamic seems an anathema - dynamic imports. For some reason, in 3.x it keeps changing all the times
.
Several days ago I published this solution - which worked in 3.5 on Mac, and turned absolutely useless in 3.4.3 - as I've found out today.
So I saw this solution on SO - and it worked in iPython 6.0, and did not work in application.
After getting lost in deprecated over deprecated
, unhelpful helps
, and other joys I came up with this solution
And why - when all is said and done - dynamic import remain cryptic and user-unfriendly? I tried it first in Python 2.7 ab.3 years ago - and event then it was rather cryptic, though more user friendly
It looks that there's one issue of Python where dynamic seems an anathema - dynamic imports. For some reason, in 3.x it keeps changing all the times

Several days ago I published this solution - which worked in 3.5 on Mac, and turned absolutely useless in 3.4.3 - as I've found out today.
So I saw this solution on SO - and it worked in iPython 6.0, and did not work in application.
After getting lost in deprecated over deprecated


try: from importlib import machinery as dynamic_importer except ImportError: from imp import machinery as dynamic_importer def dynamic_import(module_path: pathlib.PosixPath): loader = dynamic_importer.SourceFileLoader(module_path.stem, module_path.as_posix()) return loader.load_module()Does anyone know why this API keeps on changing, and what is the purpose of importlib.import_module function - when it does not really import modules?
And why - when all is said and done - dynamic import remain cryptic and user-unfriendly? I tried it first in Python 2.7 ab.3 years ago - and event then it was rather cryptic, though more user friendly

Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.