1
mr-user
13d

Please python library and framework developer , throw an exception.

Comments
  • 2
    I am looking at your tensorflow ....
  • 0
    Please 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
  • 0
    @CptFox why? An Exception is for throwing errors, or interruptions. Is that not what your libraries are doing
  • 0
    @CptFox

    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.
Add Comment