[Numpy-discussion] MAINT: Use of except-pass blocks
ben.v.root at gmail.com
Tue Apr 6 14:57:38 EDT 2021
In both of those situations, the `pass` aspect makes sense, although they
probably should specify a better exception class to catch. The first one,
with the copyto() has a comment that explains what is goingon. The second
one, dealing with adding to the docstring, is needed because one can run
python in the "optimized" mode, which strips out docstrings.
On Tue, Apr 6, 2021 at 2:27 PM Michael Dubravski <mdubravski at gmail.com>
> Hello everyone,
> There are multiple instances of except-pass blocks within the codebase
> that to my knowledge are bad practices (Referencing This StackOverflow
> For example in numpy/ma/core.py there is an except-pass block that
> catches all exceptions thrown. Another example of this can be found in
> numpy/core/function_base.py. I was wondering if it would be a good idea
> to add some print statements for logging the exceptions caught. Also for
> cases where except-pass blocks are needed, is there an explanation for not
> logging exceptions?
> Michael Dubravski
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion