-
Notifications
You must be signed in to change notification settings - Fork 714
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
Update config.py #423
Update config.py #423
Conversation
Increase code coverage.
Codecov Report
@@ Coverage Diff @@
## master #423 +/- ##
==========================================
- Coverage 81.54% 81.38% -0.17%
==========================================
Files 9 9
Lines 981 983 +2
Branches 156 156
==========================================
Hits 800 800
- Misses 90 92 +2
Partials 91 91
Continue to review full report at Codecov.
|
Can you please help a newer Python dev understand why this is better? It seems the previous way is a bit cleaner? |
As when opening a file in 'for loop' we aren't keeping any explicit reference to the opened file. Hence to close the file we need to get dependent on the garbage collector, but that may mean that the resources aren't freed in a timely manner. Also if an exception occurs file will not get closed when using |
Awesome, thank you for explaining this change @ajiteshr7!! |
Hello @ajiteshr7, |
Better file handling