pyrefly icon indicating copy to clipboard operation
pyrefly copied to clipboard

[feature] InitVars should not count as dataclass fields

Open yangdanny97 opened this issue 5 months ago • 2 comments

Describe the Bug

Followup from https://github.com/facebook/pyrefly/issues/390

We should make sure that the dataclass doesn't actually have any InitVars as members, and it's only used for generating the init/post_init signature

https://docs.python.org/3/library/dataclasses.html#dataclasses-init-only-variables

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

yangdanny97 avatar May 31 '25 02:05 yangdanny97

I can handle this issue too, if nobody else has started on it

Adist319 avatar May 31 '25 21:05 Adist319

@Adist319 sounds good, thanks!

yangdanny97 avatar May 31 '25 21:05 yangdanny97

Closed earlier PR(#436) due to some local files mistakenly committed. This PR (#437) is a clean version addressing the same issue.

Adist319 avatar Jun 06 '25 07:06 Adist319