Warning: Some posts on this platform may contain adult material intended for mature audiences only. Viewer discretion is advised. By clicking ‘Continue’, you confirm that you are 18 years or older and consent to viewing explicit content.
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
I think there’s a difference between “python guidelines encourage” something and “this is a common coding pattern.” Yes, you can use try/except for flow control, but there’s a lot of people, myself included, who try to use that style sparingly.
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
I think there’s a difference between “python guidelines encourage” something and “this is a common coding pattern.” Yes, you can use try/except for flow control, but there’s a lot of people, myself included, who try to use that style sparingly.