Cooper Lees <m...@cooperlees.com> added the comment:

Ok thanks. Looks like the warning in flake8-bugbear is the right place then, 
unfortunately.

And just to be sure:

> Note that suppress without arguments corresponds to "except" and isinstance() 
> with empty tuple.

Are you saying that `contextlib.suppress()` should effectively `except 
BaseException` (cause this is not the behavior from my tests) and suppress all 
or suppress nothing? I believe the empty tuple makes it except nothing?

```python
cooper@home1:~$ python3.11
Python 3.11.0a5+ (main, Feb 22 2022, 08:51:50) [GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import contextlib
>>> with contextlib.suppress():
...   raise ValueError("I raise ...")
...
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
ValueError: I raise ...
>>>
```

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46819>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to