Do you have a specific PEP you’re referencing or is this one of those “I assume this must be the case because of how common using try/except statements for flow control are” kind of things?
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.
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
Posts must be relevant to programming, programmers, or computer science.
No NSFW content.
Jokes must be in good taste. No hate speech, bigotry, etc.
Do you have a specific PEP you’re referencing or is this one of those “I assume this must be the case because of how common using try/except statements for flow control are” kind of things?
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.