Skip to content

Conversation

@sharkdp
Copy link
Contributor

@sharkdp sharkdp commented Jul 22, 2025

No description provided.

@sharkdp sharkdp added internal An internal refactor or improvement ty Multi-file analysis & type inference diagnostics Related to reporting of diagnostics. labels Jul 22, 2025
@github-actions
Copy link
Contributor

mypy_primer results

Changes were detected when running on open source projects
strawberry (https://github.com/strawberry-graphql/strawberry)
- error[invalid-type-form] strawberry/types/field.py:301:17: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum value
+ error[invalid-type-form] strawberry/types/field.py:301:17: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member
- error[invalid-type-form] strawberry/types/field.py:336:17: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum value
+ error[invalid-type-form] strawberry/types/field.py:336:17: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member
No memory usage changes detected ✅

@sharkdp
Copy link
Contributor Author

sharkdp commented Jul 22, 2025

- error[invalid-type-form] strawberry/types/field.py:301:17: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum value
+ error[invalid-type-form] strawberry/types/field.py:301:17: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member
- error[invalid-type-form] strawberry/types/field.py:336:17: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum value
+ error[invalid-type-form] strawberry/types/field.py:336:17: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member

Not that this PR has any behavioral changes, but those are true positives, by the way.

@sharkdp sharkdp merged commit cb60ece into main Jul 22, 2025
39 checks passed
@sharkdp sharkdp deleted the david/invalid-type-form-literal branch July 22, 2025 09:42
dcreager added a commit that referenced this pull request Jul 22, 2025
* main: (76 commits)
  Move fix suggestion to subdiagnostic (#19464)
  [ty] Implement non-stdlib stub mapping for classes and functions (#19471)
  [ty] Disallow illegal uses of `ClassVar` (#19483)
  [ty] Disallow `Final` in function parameter/return-type annotations (#19480)
  [ty] Extend `Final` test suite (#19476)
  [ty] Minor change to diagnostic message for invalid Literal uses (#19482)
  [ty] Detect illegal non-enum attribute accesses in Literal annotation (#19477)
  [ty] Reduce size of `TypeInference` (#19435)
  Run MD tests for Markdown-only changes (#19479)
  Revert "[ty] Detect illegal non-enum attribute accesses in Literal annotation"
  [ty] Detect illegal non-enum attribute accesses in Literal annotation
  [ty] Added semantic token support for more identifiers (#19473)
  [ty] Make tuple subclass constructors sound (#19469)
  [ty] Pass down specialization to generic dataclass bases (#19472)
  [ty] Garbage-collect reachability constraints (#19414)
  [ty] Implicit instance attributes declared `Final` (#19462)
  [ty] Expansion of enums into unions of literals (#19382)
  [ty] Avoid rechecking the entire project when changing the opened files (#19463)
  [ty] Add warning for unknown `TY_MEMORY_REPORT` value (#19465)
  [ty] Sync vendored typeshed stubs (#19461)
  ...
dcreager added a commit that referenced this pull request Jul 22, 2025
* main:
  [ty] Use `ThinVec` for sub segments in `PlaceExpr` (#19470)
  [ty] Splat variadic arguments into parameter list (#18996)
  [`flake8-pyi`] Skip fix if all `Union` members are `None` (`PYI016`)  (#19416)
  Skip notebook with errors in ecosystem check (#19491)
  [ty] Consistent use of American english (in rules) (#19488)
  [ty] Support iterating over enums (#19486)
  Fix panic for illegal `Literal[…]` annotations with inner subscript expressions (#19489)
  Move fix suggestion to subdiagnostic (#19464)
  [ty] Implement non-stdlib stub mapping for classes and functions (#19471)
  [ty] Disallow illegal uses of `ClassVar` (#19483)
  [ty] Disallow `Final` in function parameter/return-type annotations (#19480)
  [ty] Extend `Final` test suite (#19476)
  [ty] Minor change to diagnostic message for invalid Literal uses (#19482)
  [ty] Detect illegal non-enum attribute accesses in Literal annotation (#19477)
  [ty] Reduce size of `TypeInference` (#19435)
  Run MD tests for Markdown-only changes (#19479)
  Revert "[ty] Detect illegal non-enum attribute accesses in Literal annotation"
  [ty] Detect illegal non-enum attribute accesses in Literal annotation
  [ty] Added semantic token support for more identifiers (#19473)
  [ty] Make tuple subclass constructors sound (#19469)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

diagnostics Related to reporting of diagnostics. internal An internal refactor or improvement ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants