Skip to content

[ty] Respect non-explicitly defined dataclass params#24170

Merged
sharkdp merged 2 commits intomainfrom
david/respect-undeclared-dataclass-params
Mar 25, 2026
Merged

[ty] Respect non-explicitly defined dataclass params#24170
sharkdp merged 2 commits intomainfrom
david/respect-undeclared-dataclass-params

Conversation

@sharkdp
Copy link
Copy Markdown
Contributor

@sharkdp sharkdp commented Mar 25, 2026

Summary

It's unclear to me if this is the intention of the spec, but all other type checkers work this way, and I don't see a huge downside. The only drawback is that we might pretend that dataclass-transformers support features that they actually do not.

Related discussion: https://discord.com/channels/1415418553045352598/1415418553573572651/1486294011420610629

closes astral-sh/ty#3115

Test Plan

New regression test

@sharkdp sharkdp added the ty Multi-file analysis & type inference label Mar 25, 2026
@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Mar 25, 2026

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 86.32%. The percentage of expected errors that received a diagnostic held steady at 80.30%. The number of fully passing files held steady at 67/133.

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Mar 25, 2026

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Mar 25, 2026

ecosystem-analyzer results

No diagnostic changes detected ✅

Full report with detailed diff (timing results)

@sharkdp sharkdp force-pushed the david/respect-undeclared-dataclass-params branch 2 times, most recently from 7dfa92e to 33c8c50 Compare March 25, 2026 13:35
@sharkdp sharkdp force-pushed the david/respect-undeclared-dataclass-params branch from 33c8c50 to 46f41e9 Compare March 25, 2026 13:39
@sharkdp sharkdp marked this pull request as ready for review March 25, 2026 13:39
@sharkdp sharkdp enabled auto-merge (squash) March 25, 2026 13:46
@sharkdp sharkdp merged commit 2778dad into main Mar 25, 2026
47 of 48 checks passed
@sharkdp sharkdp deleted the david/respect-undeclared-dataclass-params branch March 25, 2026 13:52
carljm added a commit that referenced this pull request Mar 25, 2026
* main:
  [ty] make `test-case` a dev-dependency (#24187)
  [ty] implement cycle normalization for more types to prevent too-many-cycle panics (#24061)
  [ty] Silence all diagnostics in unreachable code (#24179)
  [ty] Intern `InferableTypeVars` (#24161)
  Implement unnecessary-if (RUF050) (#24114)
  Recognize `Self` annotation and `self` assignment in SLF001 (#24144)
  Bump the npm version before publish (#24178)
  [ty] Disallow Self in metaclass and static methods (#23231)
  Use trusted publishing for NPM packages (#24171)
  [ty] Respect non-explicitly defined dataclass params (#24170)
  Add RUF072: warn when using  operator on an f-string (#24162)
  [ty] Check return type of generator functions (#24026)
  Implement useless-finally (RUF-072) (#24165)
  [ty] Add test for a dataclass with a default field converter (#24169)
  [ty] Dataclass field converters (#23088)
  [flake8-bandit] Treat sys.executable as trusted input in S603 (#24106)
  [ty] Add support for `typing.Concatenate` (#23689)
  `ASYNC115`: autofix to use full qualified `anyio.lowlevel` import (#24166)
  [ty] Disallow read-only fields in TypedDict updates (#24128)
  Speed up diagnostic rendering (#24146)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive dataclass-field-order for dataclass_transform wrapper with kw_only=True

3 participants