npub1p5…r4m09 on Nostr: In #Python, I’ve always felt like try excepts with try blocks of more than 1-3 ...
In #Python, I’ve always felt like try excepts with try blocks of more than 1-3 lines were anti-pattern, but I’m having trouble finding any source that corroborates that as accepted culture.
Am I being too strict here?
It’s generally accepted anti-pattern to catch more exceptions more broadly than you intend to handle, wouldn’t it also be frowned on to test more than you need to?
Published at
2024-08-02 19:33:13Event JSON
{
"id": "436fc535ee872ef20f86f8cd1a4df4016301244983fa8f1798cfe5b933a540e6",
"pubkey": "0d2189fff82ea2ea8b58955b87381480aebc660923db49d60e3b6574c71026c2",
"created_at": 1722627193,
"kind": 1,
"tags": [
[
"t",
"python"
],
[
"proxy",
"https://mastodon.social/users/diji/statuses/112894095742505691",
"activitypub"
]
],
"content": "In #Python, I’ve always felt like try excepts with try blocks of more than 1-3 lines were anti-pattern, but I’m having trouble finding any source that corroborates that as accepted culture.\n\nAm I being too strict here?\n\nIt’s generally accepted anti-pattern to catch more exceptions more broadly than you intend to handle, wouldn’t it also be frowned on to test more than you need to?",
"sig": "39dbfb9a842f810d029ef3d378746ad7e72ac93aeeb44bd1baf21480ec999e48d7e498b05c8ae465e798e3696dc98f7785ba00920e3316c0e09595ab9136334a"
}