STFU those exceptions (explicitly)
Project description
Silence chosen exceptions.
stfu is a replacement for the idiom:
try:
may_raise_exception()
except Exception:
pass
Just write:
with stfu:
may_raise_exception()
with stfu(TypeError, ValueError):
may_raise_type_or_value_error()
To catch everything (even KeyboardInterrup and StopIteration):
with stfu_all:
may_raise_any_exception()
Remember to import it:
from stfu import stfu
from stfu import stfu_all
Errors should never pass silently.
Unless explicitly silenced.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stfu-1.3.tar.gz
(1.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stfu-1.3.tar.gz.
File metadata
- Download URL: stfu-1.3.tar.gz
- Upload date:
- Size: 1.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b2922484eb5ec2076db87f3b5df4fcc22fcf4a6183e76c92db2f4cfb9b4924f
|
|
| MD5 |
d21e79970a159754d9a1f9cbdec2ce1d
|
|
| BLAKE2b-256 |
578a16cbdd8d00d1e3122685c075b09b34fd6e327fb79d9b9bc42777ac803b2c
|
File details
Details for the file stfu-1.3-py2.py3-none-any.whl.
File metadata
- Download URL: stfu-1.3-py2.py3-none-any.whl
- Upload date:
- Size: 1.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ef6944d07a77e9642b23525780b56c729d619b9ad511bd11d1357ab5071fedb
|
|
| MD5 |
4979a91c2b35263e1c15fe22e4e60bd4
|
|
| BLAKE2b-256 |
79a351b6f26b4d0201de644e3a79a8e8d6f664246d2dc477c28aef05be730896
|