4 ms·
> having to use lots of assert(isinstance(arg, type) at the beginning of almost every function Python should not be written like this; assertions can be ignore
by vonseel 8y ago
> having to use lots of assert(isinstance(arg, type) at the beginning of almost every function
Python should not be written like this; assertions can be ignored at runtime: https://docs.python.org/3/using/cmdline.html#cmdoption-o https://docs.python.org/3/using/cmdline.html#cmdoption-o
A much better solution is to use qualified try/except blocks to handle potential errors.