4 ms·
Please allow me to vent on python packaging. I was working to debug a very weird error that was happening in my code only when my app was raising a warning thr
by whatever1 4y ago
Please allow me to vent on python packaging.
I was working to debug a very weird error that was happening in my code only when my app was raising a warning through my `warnings.py`.
My code was importing numpy, which in turn was trying to import its own `warnings.py`, but because of the python environment precedence, it was loading my own `warnings.py` which unfortunately had the same name.
How on earth was this something that passed the design of the import / package system of python? Why there are not unique id’s for the imported modules?
TLDR: An imported package took dependency on my own code because of module name clashing and lead to unexpected behavior.
- greazy 4y agoHow does 'warnings.py' work with the rest of the code? Intrigued as I've put myself into a corner with the way warnings/errors are handled in my project. By the way I think there is a convention to handle these issues but it appears numpy isn't using it. If I remember correctly, any module with __ infront will be called {package}.__{module}.