Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
mr-user118313dI am looking at your tensorflow ....
CptFox170812dPlease Python libraries (especially IO ones) : stop using exceptions as the only mean of flow control
It's rather rare to see someone complaining that their libs don't throw enough exceptions, I'm so used to the opposite
The IO library can just use nullable data structure as other mean of flow control.
The main problem I have it that the developer let it escape with error. I am left with 100 level deep call stack which can not be interpreted in anyway to know what went wrong.
I am sure it not a right way but the python code I wrote use type hint and ignore compatibility with python 2. The safe mode is turn on as default.
if the safe mode is turn on , I use a defensive programming checking parameter for correct type. If you provide incorrect one I throw the exception.
My policy is that I guarantee that the program will work if you use the correct type. Otherwise you reap what you sow.