snekmuffin@lemmy.dbzer0.comtoProgrammer Humor@lemmy.ml•Always follow 3-2-1 backup rule
7·
6 months agoTruers, just mentioning it
abstract shape in bio
Truers, just mentioning it
Tbf python guidelines encourage it over if/else in cases like this. “Easier to ask for forgiveness than for permission” or something along the lines
Pretty sure its not a PEP, but the python glossary mentions it. Searching ‘python EAFP’ brings up a lot of discussion on the topic too, so if nothing else its definitely a widespread phenomenon