-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
C406 false positive #260
Comments
I think it can only be turned into a dict literal when every element in the list is either a two-tuple or a two-list |
although lists and tuples of other lengths would explode in the dict constructor, so when every element is either a tuple or list should be sufficient |
|
although, for the original case, I prefer to use
so perhaps it should be moved to a different error code, with a suggestion to unpack and use a dict literal |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [flake8-comprehensions](https://togithub.com/adamchainz/flake8-comprehensions) ([changelog](https://togithub.com/adamchainz/flake8-comprehensions/blob/main/CHANGELOG.rst)) | `3.11.0` -> `3.11.1` | [![age](https://badges.renovateapi.com/packages/pypi/flake8-comprehensions/3.11.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/flake8-comprehensions/3.11.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/flake8-comprehensions/3.11.1/compatibility-slim/3.11.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/flake8-comprehensions/3.11.1/confidence-slim/3.11.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>adamchainz/flake8-comprehensions</summary> ### [`v3.11.1`](https://togithub.com/adamchainz/flake8-comprehensions/blob/HEAD/CHANGELOG.rst#​3111-2023-03-21) [Compare Source](https://togithub.com/adamchainz/flake8-comprehensions/compare/3.11.0...3.11.1) - Fix false positives in C406 “unnecessary dict literal”. Fixes `Issue #​260 <https://github.com/adamchainz/flake8-comprehensions/issues/260>`\__. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/jankatins/pr-workflow-example). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xNC4yIiwidXBkYXRlZEluVmVyIjoiMzUuMTQuMiJ9-->
Bumps [flake8-comprehensions](https://github.com/adamchainz/flake8-comprehensions) from 3.10.1 to 3.12.0. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/adamchainz/flake8-comprehensions/blob/main/CHANGELOG.rst">flake8-comprehensions's changelog</a>.</em></p> <blockquote> <h2>3.12.0 (2023-04-13)</h2> <ul> <li> <p>Add rule C418 to check for calls passing a dict literal or dict comprehension to <code>dict()</code>.</p> </li> <li> <p>Add rule C419 to check for calls passing a list comprehension to <code>any()</code>/<code>all()</code>.</p> </li> </ul> <h2>3.11.1 (2023-03-21)</h2> <ul> <li> <p>Fix false positives in C406 “unnecessary dict literal”.</p> <p>Fixes <code>Issue [#260](adamchainz/flake8-comprehensions#260) <https://github.com/adamchainz/flake8-comprehensions/issues/260></code>__.</p> </li> </ul> <h2>3.11.0 (2023-03-18)</h2> <ul> <li> <p>Expand C416 to <code>dict</code> comprehensions.</p> <p>Thanks to Aaron Gokaslan in <code>PR [#490](adamchainz/flake8-comprehensions#490) <https://github.com/adamchainz/flake8-comprehensions/pull/490></code>__.</p> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/d8d15cfd0846df1c611dfb1f214174bcb56a869d"><code>d8d15cf</code></a> Version 3.12.0</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/867247f8f4c1bd521b8c482b4f375336f05aa639"><code>867247f</code></a> Add rule for list comprehensions passed to any()/all() (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/427">#427</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/b6c2b95de32f474173b2f3c0be33aa6669105b05"><code>b6c2b95</code></a> Add rule for unnecessary dict() calls (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/500">#500</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/c7e7ffbdebc6104ebb4508ca7c583612d3073942"><code>c7e7ffb</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/498">#498</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/59f6bc94679600b8439cfe05c2fd7c1b2f380049"><code>59f6bc9</code></a> Upgrade requirements (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/497">#497</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/b5d223c13a62f62875c8c0db36a6794a562227b7"><code>b5d223c</code></a> Add tox-ini-fmt pre-commit hook (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/496">#496</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/b4fdcc313b1e67559e48bff7e90c6236d7a72abf"><code>b4fdcc3</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/495">#495</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/1f34ce5edb018924dac18e59276390e09c003d24"><code>1f34ce5</code></a> Upgrade requirements (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/494">#494</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/bdc1d00f0aee4c937d48af03b6d376149e2f8831"><code>bdc1d00</code></a> Version 3.11.1</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/34ae012bce5885ed0d465b8567ded8bc4f086929"><code>34ae012</code></a> Improve documentation (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/492">#492</a>)</li> <li>Additional commits viewable in <a href="https://github.com/adamchainz/flake8-comprehensions/compare/3.10.1...3.12.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=flake8-comprehensions&package-manager=pip&previous-version=3.10.1&new-version=3.12.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [flake8-comprehensions](https://github.com/adamchainz/flake8-comprehensions) from 3.10.1 to 3.12.0. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/adamchainz/flake8-comprehensions/blob/main/CHANGELOG.rst">flake8-comprehensions's changelog</a>.</em></p> <blockquote> <h2>3.12.0 (2023-04-13)</h2> <ul> <li> <p>Add rule C418 to check for calls passing a dict literal or dict comprehension to <code>dict()</code>.</p> </li> <li> <p>Add rule C419 to check for calls passing a list comprehension to <code>any()</code>/<code>all()</code>.</p> </li> </ul> <h2>3.11.1 (2023-03-21)</h2> <ul> <li> <p>Fix false positives in C406 “unnecessary dict literal”.</p> <p>Fixes <code>Issue [#260](adamchainz/flake8-comprehensions#260) <https://github.com/adamchainz/flake8-comprehensions/issues/260></code>__.</p> </li> </ul> <h2>3.11.0 (2023-03-18)</h2> <ul> <li> <p>Expand C416 to <code>dict</code> comprehensions.</p> <p>Thanks to Aaron Gokaslan in <code>PR [#490](adamchainz/flake8-comprehensions#490) <https://github.com/adamchainz/flake8-comprehensions/pull/490></code>__.</p> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/d8d15cfd0846df1c611dfb1f214174bcb56a869d"><code>d8d15cf</code></a> Version 3.12.0</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/867247f8f4c1bd521b8c482b4f375336f05aa639"><code>867247f</code></a> Add rule for list comprehensions passed to any()/all() (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/427">#427</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/b6c2b95de32f474173b2f3c0be33aa6669105b05"><code>b6c2b95</code></a> Add rule for unnecessary dict() calls (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/500">#500</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/c7e7ffbdebc6104ebb4508ca7c583612d3073942"><code>c7e7ffb</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/498">#498</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/59f6bc94679600b8439cfe05c2fd7c1b2f380049"><code>59f6bc9</code></a> Upgrade requirements (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/497">#497</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/b5d223c13a62f62875c8c0db36a6794a562227b7"><code>b5d223c</code></a> Add tox-ini-fmt pre-commit hook (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/496">#496</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/b4fdcc313b1e67559e48bff7e90c6236d7a72abf"><code>b4fdcc3</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/495">#495</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/1f34ce5edb018924dac18e59276390e09c003d24"><code>1f34ce5</code></a> Upgrade requirements (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/494">#494</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/bdc1d00f0aee4c937d48af03b6d376149e2f8831"><code>bdc1d00</code></a> Version 3.11.1</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/34ae012bce5885ed0d465b8567ded8bc4f086929"><code>34ae012</code></a> Improve documentation (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/492">#492</a>)</li> <li>Additional commits viewable in <a href="https://github.com/adamchainz/flake8-comprehensions/compare/3.10.1...3.12.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=flake8-comprehensions&package-manager=pip&previous-version=3.10.1&new-version=3.12.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
… /src/bindings/python (#25300) Updates the requirements on [flake8-comprehensions](https://github.com/adamchainz/flake8-comprehensions) to permit the latest version. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/adamchainz/flake8-comprehensions/blob/main/CHANGELOG.rst">flake8-comprehensions's changelog</a>.</em></p> <blockquote> <h2>3.15.0 (2024-06-29)</h2> <ul> <li> <p>Add rule C420 to check for dict comprehensions with constant values, encouraging replacement with <code>dict.fromkeys()</code>.</p> <p>Thanks to Tom Kuson in <code>PR [#553](adamchainz/flake8-comprehensions#553) <https://github.com/adamchainz/flake8-comprehensions/pull/553></code>__.</p> </li> </ul> <h2>3.14.0 (2023-07-10)</h2> <ul> <li>Drop Python 3.7 support.</li> </ul> <h2>3.13.0 (2023-06-15)</h2> <ul> <li>Support Python 3.12.</li> </ul> <h2>3.12.0 (2023-04-13)</h2> <ul> <li> <p>Add rule C418 to check for calls passing a dict literal or dict comprehension to <code>dict()</code>.</p> </li> <li> <p>Add rule C419 to check for calls passing a list comprehension to <code>any()</code>/<code>all()</code>.</p> </li> </ul> <h2>3.11.1 (2023-03-21)</h2> <ul> <li> <p>Fix false positives in C406 “unnecessary dict literal”.</p> <p>Fixes <code>Issue [#260](adamchainz/flake8-comprehensions#260) <https://github.com/adamchainz/flake8-comprehensions/issues/260></code>__.</p> </li> </ul> <h2>3.11.0 (2023-03-18)</h2> <ul> <li> <p>Expand C416 to <code>dict</code> comprehensions.</p> <p>Thanks to Aaron Gokaslan in <code>PR [#490](adamchainz/flake8-comprehensions#490) <https://github.com/adamchainz/flake8-comprehensions/pull/490></code>__.</p> </li> </ul> <h2>3.10.1 (2022-10-29)</h2> <ul> <li> <p>Fix false positive in rules C402 and C404 for <code>dict()</code> calls with keyword arguments.</p> <p>Thanks to Anders Kaseorg for the report in <code>Issue [#457](adamchainz/flake8-comprehensions#457) <https://github.com/adamchainz/flake8-comprehensions/issues/457></code>__.</p> </li> </ul> <h2>3.10.0 (2022-05-19)</h2> <ul> <li>Add rule C417 which recommends rewriting use of <code>map()</code> with <code>lambda</code> to an equivalent generator expression or comprehension.</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/b348af1c22e8ef34e2fd9b501918b4f45002db20"><code>b348af1</code></a> Version 3.15.0</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/1ae816f430a668ee527d1fd240640cff291b84cb"><code>1ae816f</code></a> Add rule for dict comprehensions with constant values (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/553">#553</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/226a7e0e58b231d8ae47080a4459172b9a29b708"><code>226a7e0</code></a> Improve MyPy configuration</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/a562c757802890635d0723dfc312be496f2c978b"><code>a562c75</code></a> Tidy pyproject.toml readme and license fields</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/e609dea5202dd0663a996c11883da7723f69e9c8"><code>e609dea</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/579">#579</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/9506eef08eca053bbca03fd8d2eef54b6caff5ec"><code>9506eef</code></a> Upgrade requirements (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/578">#578</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/353b7b5f4571ac620fd2db62680cffccc219a2d9"><code>353b7b5</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/577">#577</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/419907c69778ad9e3c5fedb1a3e6700a9584a680"><code>419907c</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/576">#576</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/75cf66dc88b690941fac2c1a4e5255d1343a2c87"><code>75cf66d</code></a> Upgrade requirements (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/575">#575</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/b0dd1652ec50fb9e2b50b69aece0f85fd547894a"><code>b0dd165</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/574">#574</a>)</li> <li>Additional commits viewable in <a href="https://github.com/adamchainz/flake8-comprehensions/compare/1.0.0...3.15.0">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
… /src/bindings/python (#27268) Updates the requirements on [flake8-comprehensions](https://github.com/adamchainz/flake8-comprehensions) to permit the latest version. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/adamchainz/flake8-comprehensions/blob/main/CHANGELOG.rst">flake8-comprehensions's changelog</a>.</em></p> <blockquote> <h2>3.16.0 (2024-10-27)</h2> <ul> <li> <p>Drop Python 3.8 support.</p> </li> <li> <p>Support Python 3.13.</p> </li> </ul> <h2>3.15.0 (2024-06-29)</h2> <ul> <li> <p>Add rule C420 to check for dict comprehensions with constant values, encouraging replacement with <code>dict.fromkeys()</code>.</p> <p>Thanks to Tom Kuson in <code>PR [#553](adamchainz/flake8-comprehensions#553) <https://github.com/adamchainz/flake8-comprehensions/pull/553></code>__.</p> </li> </ul> <h2>3.14.0 (2023-07-10)</h2> <ul> <li>Drop Python 3.7 support.</li> </ul> <h2>3.13.0 (2023-06-15)</h2> <ul> <li>Support Python 3.12.</li> </ul> <h2>3.12.0 (2023-04-13)</h2> <ul> <li> <p>Add rule C418 to check for calls passing a dict literal or dict comprehension to <code>dict()</code>.</p> </li> <li> <p>Add rule C419 to check for calls passing a list comprehension to <code>any()</code>/<code>all()</code>.</p> </li> </ul> <h2>3.11.1 (2023-03-21)</h2> <ul> <li> <p>Fix false positives in C406 “unnecessary dict literal”.</p> <p>Fixes <code>Issue [#260](adamchainz/flake8-comprehensions#260) <https://github.com/adamchainz/flake8-comprehensions/issues/260></code>__.</p> </li> </ul> <h2>3.11.0 (2023-03-18)</h2> <ul> <li> <p>Expand C416 to <code>dict</code> comprehensions.</p> <p>Thanks to Aaron Gokaslan in <code>PR [#490](adamchainz/flake8-comprehensions#490) <https://github.com/adamchainz/flake8-comprehensions/pull/490></code>__.</p> </li> </ul> <h2>3.10.1 (2022-10-29)</h2> <ul> <li>Fix false positive in rules C402 and C404 for <code>dict()</code> calls with keyword arguments.</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/bf5861b1b3d1eb1b661a34ae71db1a2bf80ced5d"><code>bf5861b</code></a> Version 3.16.0</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/bd8b05591006538f60602403dc2448e0c9c4f12d"><code>bd8b055</code></a> Drop Python 3.8 support (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/600">#600</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/cfba30c175ddc41f2a43a94cbffac013b9fccac1"><code>cfba30c</code></a> Add automated release process (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/601">#601</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/e49e753e5661e17a553d14a610f0807152d9f843"><code>e49e753</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/599">#599</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/2bc3ccbe27502377a7fd244714f1ce1d6c2efc84"><code>2bc3ccb</code></a> Bump astral-sh/setup-uv from 1 to 3 in the github-actions group (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/598">#598</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/a7842a644ff573e5d567b52332fb5cb27889adaf"><code>a7842a6</code></a> Support Python 3.13 (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/597">#597</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/7df8477e2b055fdc1fd0ae51f2bed75152e54c8a"><code>7df8477</code></a> Upgrade requirements (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/596">#596</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/4272785a82e6603fac06c67ef9457d2a9a88550e"><code>4272785</code></a> Use uv on GitHub Actions (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/595">#595</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/a03d78f1845b6b3034f39b08eda3fba47af20fa7"><code>a03d78f</code></a> Move automatic updates to monthly</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/5ea939475914a2a534bd302c4fe5f3e704c30c95"><code>5ea9394</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/594">#594</a>)</li> <li>Additional commits viewable in <a href="https://github.com/adamchainz/flake8-comprehensions/compare/1.0.0...3.16.0">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
… /src/bindings/python (openvinotoolkit#27268) Updates the requirements on [flake8-comprehensions](https://github.com/adamchainz/flake8-comprehensions) to permit the latest version. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/adamchainz/flake8-comprehensions/blob/main/CHANGELOG.rst">flake8-comprehensions's changelog</a>.</em></p> <blockquote> <h2>3.16.0 (2024-10-27)</h2> <ul> <li> <p>Drop Python 3.8 support.</p> </li> <li> <p>Support Python 3.13.</p> </li> </ul> <h2>3.15.0 (2024-06-29)</h2> <ul> <li> <p>Add rule C420 to check for dict comprehensions with constant values, encouraging replacement with <code>dict.fromkeys()</code>.</p> <p>Thanks to Tom Kuson in <code>PR [openvinotoolkit#553](adamchainz/flake8-comprehensions#553) <https://github.com/adamchainz/flake8-comprehensions/pull/553></code>__.</p> </li> </ul> <h2>3.14.0 (2023-07-10)</h2> <ul> <li>Drop Python 3.7 support.</li> </ul> <h2>3.13.0 (2023-06-15)</h2> <ul> <li>Support Python 3.12.</li> </ul> <h2>3.12.0 (2023-04-13)</h2> <ul> <li> <p>Add rule C418 to check for calls passing a dict literal or dict comprehension to <code>dict()</code>.</p> </li> <li> <p>Add rule C419 to check for calls passing a list comprehension to <code>any()</code>/<code>all()</code>.</p> </li> </ul> <h2>3.11.1 (2023-03-21)</h2> <ul> <li> <p>Fix false positives in C406 “unnecessary dict literal”.</p> <p>Fixes <code>Issue [openvinotoolkit#260](adamchainz/flake8-comprehensions#260) <https://github.com/adamchainz/flake8-comprehensions/issues/260></code>__.</p> </li> </ul> <h2>3.11.0 (2023-03-18)</h2> <ul> <li> <p>Expand C416 to <code>dict</code> comprehensions.</p> <p>Thanks to Aaron Gokaslan in <code>PR [openvinotoolkit#490](adamchainz/flake8-comprehensions#490) <https://github.com/adamchainz/flake8-comprehensions/pull/490></code>__.</p> </li> </ul> <h2>3.10.1 (2022-10-29)</h2> <ul> <li>Fix false positive in rules C402 and C404 for <code>dict()</code> calls with keyword arguments.</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/bf5861b1b3d1eb1b661a34ae71db1a2bf80ced5d"><code>bf5861b</code></a> Version 3.16.0</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/bd8b05591006538f60602403dc2448e0c9c4f12d"><code>bd8b055</code></a> Drop Python 3.8 support (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/600">#600</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/cfba30c175ddc41f2a43a94cbffac013b9fccac1"><code>cfba30c</code></a> Add automated release process (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/601">#601</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/e49e753e5661e17a553d14a610f0807152d9f843"><code>e49e753</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/599">#599</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/2bc3ccbe27502377a7fd244714f1ce1d6c2efc84"><code>2bc3ccb</code></a> Bump astral-sh/setup-uv from 1 to 3 in the github-actions group (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/598">#598</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/a7842a644ff573e5d567b52332fb5cb27889adaf"><code>a7842a6</code></a> Support Python 3.13 (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/597">#597</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/7df8477e2b055fdc1fd0ae51f2bed75152e54c8a"><code>7df8477</code></a> Upgrade requirements (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/596">#596</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/4272785a82e6603fac06c67ef9457d2a9a88550e"><code>4272785</code></a> Use uv on GitHub Actions (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/595">#595</a>)</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/a03d78f1845b6b3034f39b08eda3fba47af20fa7"><code>a03d78f</code></a> Move automatic updates to monthly</li> <li><a href="https://github.com/adamchainz/flake8-comprehensions/commit/5ea939475914a2a534bd302c4fe5f3e704c30c95"><code>5ea9394</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/adamchainz/flake8-comprehensions/issues/594">#594</a>)</li> <li>Additional commits viewable in <a href="https://github.com/adamchainz/flake8-comprehensions/compare/1.0.0...3.16.0">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
With
something
assigned to a two-tuple,dict([something])
incorrectly gets marked by C406 as something that can be converted to a dict literal.The text was updated successfully, but these errors were encountered: