We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Feature
Adding a warning or error if an expression is not assigned would encourage callers to handle return types and pick up on changes to APIs.
Pitch
Imagine you have this api:
def fleeb_the_foo() -> None: print("fleebing") def main() -> None: fleeb_the_foo()
Then you change it later:
def fleeb_the_foo() -> Bool: print("I failed to fleeb!") return False def main() -> None: fleeb_the_foo() # <<--- a warning or error here!
If you don't want to handle the warning/error:
def fleeb_the_foo() -> Bool: print("I failed to fleeb!") return False def main() -> None: _ = fleeb_the_foo() # error is suppressed
This is already implemented to some degree with pylint for unassigned expressions with [expression-not-assigned]
str(42) == "42" # [expression-not-assigned]
The text was updated successfully, but these errors were encountered:
I should also mention that there is precedent for this in order languages (C++ [[nodiscard]] and Swift: https://www.avanderlee.com/swift/discardableresult/)
Sorry, something went wrong.
No branches or pull requests
Feature
Adding a warning or error if an expression is not assigned would encourage callers to handle return types and pick up on changes to APIs.
Pitch
Imagine you have this api:
Then you change it later:
If you don't want to handle the warning/error:
This is already implemented to some degree with pylint for unassigned expressions with [expression-not-assigned]
The text was updated successfully, but these errors were encountered: