-
Notifications
You must be signed in to change notification settings - Fork 26
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
Remove unnecessary pass statements #670
Remove unnecessary pass statements #670
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #670 +/- ##
==========================================
- Coverage 30.16% 30.11% -0.06%
==========================================
Files 139 139
Lines 22551 22437 -114
==========================================
- Hits 6803 6757 -46
+ Misses 15748 15680 -68 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please be careful when removing pass
statements, as they're sometimes used in important ways to indicate that a function or class is not implemented. Without a function definition, Python will throw errors.
Passes are not required for abstract methods, as long as there's a docstring. I already tested this and no errors are thrown. From looking online, this is seems to be the preferred way to do it. https://stackoverflow.com/questions/45826692/body-of-abstract-method-in-python-3-5 |
While this is true, relying on Python's evaluation of the docstring doesn't provide the user with much feedback if they're using a method that hasn't yet been overridden. Best practice is to raise a |
Okay, I'll raise a NotImplementedError then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nearly there
…nnecessary-pass-statements
No description provided.