-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[Refactor] Fix ruff rule E714: Test for object identity should be is not
#49813
[Refactor] Fix ruff rule E714: Test for object identity should be is not
#49813
Conversation
… not` Signed-off-by: Chi-Sheng Liu <[email protected]>
rllib/utils/deprecation.py
Outdated
@@ -40,7 +40,7 @@ def deprecation_warning( | |||
) | |||
|
|||
if error: | |||
if not type(error) is bool and issubclass(error, Exception): | |||
if type(error) is not bool and issubclass(error, Exception): |
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.
this should be isinstance(error, bool)
?
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.
It should be fixed in rule E721
, not this PR.
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.
could you just change it to isinstance
here?
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.
Fixed in b46ff94
Signed-off-by: Chi-Sheng Liu <[email protected]>
Signed-off-by: Lonnie Liu <[email protected]>
Signed-off-by: Lonnie Liu <[email protected]>
… not` (#49813) Auto-fixed by ruff using pre-commit run ruff --all-files.
Why are these changes needed?
As title.
Note: Auto-fixed by
ruff
usingpre-commit run ruff --all-files
.Related issue number
N/A
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.