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

Document literal-membership fix safety conditions #9677

Merged
merged 1 commit into from
Jan 29, 2024
Merged

Conversation

charliermarsh
Copy link
Member

Summary

This seems safe to me. See #8482 (comment).

Test Plan

cargo test

@charliermarsh charliermarsh added the preview Related to preview mode features label Jan 29, 2024
@charliermarsh charliermarsh added this to the v0.2.0 milestone Jan 29, 2024
@charliermarsh
Copy link
Member Author

For 0.2.

@zanieb
Copy link
Member

zanieb commented Jan 29, 2024

Isn't this unsafe because the inner type may not be hashable?

@charliermarsh
Copy link
Member Author

Good call, thank you! I'll just change this to a docs update and merge.

Copy link
Contributor

github-actions bot commented Jan 29, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+0 -180 violations, +0 -0 fixes in 5 projects; 38 projects unchanged)

RasaHQ/rasa (+0 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

- tests/utils/tensorflow/test_rasa_layers.py:832:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks

alteryx/featuretools (+0 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

- featuretools/entityset/entityset.py:402:17: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks

bokeh/bokeh (+0 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview --select ALL

- examples/server/app/crossfilter/main.py:32:35: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks

ibis-project/ibis (+0 -2 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

- ibis/backends/bigquery/tests/system/test_client.py:222:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- ibis/backends/bigquery/tests/system/test_client.py:223:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks

pandas-dev/pandas (+0 -175 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

- pandas/core/_numba/extensions.py:52:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/algorithms.py:533:13: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/algorithms.py:790:36: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/algorithms.py:940:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/algorithms.py:940:38: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/array_algos/putmask.py:138:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/array_algos/putmask.py:44:13: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/arrays/datetimelike.py:661:40: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/arrays/datetimelike.py:774:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/arrays/datetimelike.py:780:20: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/arrays/datetimes.py:2426:10: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/arrays/interval.py:257:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/arrays/masked.py:968:30: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/arrays/numeric.py:164:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/arrays/string_arrow.py:656:32: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/arrays/timedeltas.py:1040:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/arrays/timedeltas.py:647:20: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/computation/expressions.py:200:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/construction.py:551:39: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/construction.py:605:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/construction.py:652:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/dtypes/astype.py:103:10: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/dtypes/astype.py:131:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/dtypes/cast.py:1036:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/dtypes/cast.py:1065:21: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/dtypes/cast.py:1091:21: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/dtypes/cast.py:1179:45: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/dtypes/cast.py:1700:8: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/dtypes/dtypes.py:450:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/dtypes/missing.py:643:10: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/frame.py:11535:33: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/frame.py:2482:24: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/frame.py:8129:20: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/groupby/generic.py:1670:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/groupby/groupby.py:1977:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/indexers/utils.py:321:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/indexes/base.py:5558:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/indexes/base.py:7013:56: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/indexes/base.py:7031:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/indexes/base.py:7051:17: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/indexes/base.py:7054:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/indexes/base.py:7054:37: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/indexes/base.py:7124:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/indexes/base.py:873:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/indexes/datetimelike.py:156:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/internals/concat.py:371:12: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/internals/managers.py:509:16: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
- pandas/core/nanops.py:1682:14: E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
... 127 additional changes omitted for project

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
E721 180 0 180 0 0

@charliermarsh charliermarsh added documentation Improvements or additions to documentation and removed preview Related to preview mode features labels Jan 29, 2024
@charliermarsh charliermarsh changed the title Convert literal-membership to a safe edit Document literal-membership fix safety conditions Jan 29, 2024
@charliermarsh charliermarsh enabled auto-merge (squash) January 29, 2024 17:42
@charliermarsh charliermarsh merged commit 05a2f52 into main Jan 29, 2024
16 checks passed
@charliermarsh charliermarsh deleted the charlie/s branch January 29, 2024 17:48
zanieb pushed a commit that referenced this pull request Jan 29, 2024
## Summary

This seems safe to me. See
#8482 (comment).

## Test Plan

`cargo test`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants