If you enjoyed this walkthrough make sure to check part 2 where I'm adding an assertion library: ua-cam.com/video/dl_vjsG2F8E/v-deo.html, and later this month I'm planning to release part 3
Nice one! I think it would be better to use `finally/else` along with try and except. Also an interesting addition would be to evaluate the code using the `ast` and give the proper tracebacks and where it fails.
Thanks for great ideas! I've looked at the ast module, I'm certainly going to play with it, and hopefully will add this feature too, so that it works similarly to pytest. Regarding finally/else, what code would you add to the "else" block? I could put printing the success message there, but I'm not sure how that makes it better, so I guess you had some other idea
@@NotOnlyCode Yeah my idea was to put the success message in the `else` block, I think that it would make more coherent code, I am not aware if it's going to be better like performance wise (or if it is it shouldn't be notable).
Maybe you have a typo? It should be "importlib.machinery.SourceFileLoader" (capital "S" in "Source"). Other than that no idea what it could be, I just opened that file in VScode and it finds the file
If you enjoyed this walkthrough make sure to check part 2 where I'm adding an assertion library: ua-cam.com/video/dl_vjsG2F8E/v-deo.html, and later this month I'm planning to release part 3
Really cool 😎
gold, thank you so much
Nice one! I think it would be better to use `finally/else` along with try and except. Also an interesting addition would be to evaluate the code using the `ast` and give the proper tracebacks and where it fails.
Thanks for great ideas! I've looked at the ast module, I'm certainly going to play with it, and hopefully will add this feature too, so that it works similarly to pytest.
Regarding finally/else, what code would you add to the "else" block? I could put printing the success message there, but I'm not sure how that makes it better, so I guess you had some other idea
@@NotOnlyCode Yeah my idea was to put the success message in the `else` block, I think that it would make more coherent code, I am not aware if it's going to be better like performance wise (or if it is it shouldn't be notable).
machinery.SourceFileLoader is depricated since python 3.6; it's mentioned in the documentation.
How to import the modules from command line now :(
The class is not deprecated, only the "load_module" method. I use "exec_module" which is recommended replacement since Python 3.6
@@NotOnlyCode VS Code is not able to recognize importlib.machinery.sourceFileLoader :(
Maybe you have a typo? It should be "importlib.machinery.SourceFileLoader" (capital "S" in "Source"). Other than that no idea what it could be, I just opened that file in VScode and it finds the file