Skip to content

Comments

[flake8-comprehensions] Skip when TypeError present from too many (kw)args for C410,C411, and C418#15838

Merged
dylwil3 merged 3 commits intoastral-sh:mainfrom
dylwil3:compr-args-count
Jan 30, 2025
Merged

[flake8-comprehensions] Skip when TypeError present from too many (kw)args for C410,C411, and C418#15838
dylwil3 merged 3 commits intoastral-sh:mainfrom
dylwil3:compr-args-count

Conversation

@dylwil3
Copy link
Collaborator

@dylwil3 dylwil3 commented Jan 30, 2025

Both list and dict expect only a single positional argument. Giving more positional arguments, or a keyword argument, is a TypeError and neither the lint rule nor its fix make sense in that context.

Closes #15810

@dylwil3 dylwil3 added bug Something isn't working rule Implementing or modifying a lint rule labels Jan 30, 2025
@github-actions
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@dylwil3 dylwil3 merged commit 071862a into astral-sh:main Jan 30, 2025
21 checks passed
dcreager added a commit that referenced this pull request Jan 31, 2025
* main:
  [`flake8-pyi`] Fix several correctness issues with `custom-type-var-return-type` (`PYI019`) (#15851)
  [`pyupgrade`] Reuse replacement logic from `UP046` and `UP047` (`UP040`) (#15840)
  [`refurb`] Avoid `None | None` as well as better detection and fix (`FURB168`) (#15779)
  Remove non-existing `lint.extendIgnore` editor setting (#15844)
  [`refurb`] Mark fix as unsafe if there are comments (`FURB171`) (#15832)
  [`flake8-comprehensions`] Skip when `TypeError` present from too many (kw)args for `C410`,`C411`, and `C418` (#15838)
  [`pyflakes`] Visit forward annotations in `TypeAliasType` as types (`F401`) (#15829)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C410, C411, and C418 have false positives for calls with extra arguments

2 participants