Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readability/EAFP: update to Py 3, use specific exception, add race condition note #144

Merged
merged 1 commit into from
Feb 28, 2020

Conversation

kwi-dk
Copy link
Contributor

@kwi-dk kwi-dk commented Jan 23, 2020

Add a note about the non-EAFP example code also having a potential race
condition (which is one of the reasons why the EAFP style is preferred).

Update best practice code to catch the specific FileNotFoundError (new
in Python 3.3), instead of the overly broad OSError. (Add note about
using OSError in Python 2, but caution that it may be too broad.)

Update glossary link to point to Python 3 docs, for good measure.

…ndition note

Add a note about the non-EAFP example code also having a potential race
condition (which is one of the reasons why the EAFP style is preferred).

Update best practice code to catch the specific FileNotFoundError (new
in Python 3.3), instead of the overly broad OSError. (Add note about
using OSError in Python 2, but caution that it may be too broad.)

Update glossary link to point to Python 3 docs, for good measure.
@dmtucker
Copy link

Related: #125

dmtucker
dmtucker approved these changes Jan 27, 2020
@adewes adewes merged commit d88697d into quantifiedcode:master Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants