Skip to content

Remove special handling of kw_only in dataclass plugin serialization #15502

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

Merged
merged 1 commit into from
Jun 24, 2023

Conversation

sobolevn
Copy link
Member

It is not needed, because it is always serialized as bool and is always present.

It was added a long time ago in #10867 as a compat layer. But, since then we've added at least one is_neither_frozen_nor_nonfrozen attribute that is serialized / deserialized in a common way.

So, let's remove this hack for good.

It is not needed, because it is always serialized as `bool` and is always present.

It was added a long time ago in #10867 as a compat layer. But, since then we've added at least one `is_neither_frozen_nor_nonfrozen` attribute that is serialized / deserialized in a common way.

So, let's remove this hack for good.
@sobolevn
Copy link
Member Author

@ikonst do you want to take a look?

@github-actions
Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Copy link
Contributor

@ikonst ikonst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Curious if it was ever needed. It looks like cache is invalidated when version_id changes, and version_id contains the current git rev:

mypy/mypy/version.py

Lines 15 to 18 in 5b6dc5f

if __version__.endswith("+dev") and git.is_git_repo(mypy_dir) and git.have_git():
__version__ += "." + git.git_revision(mypy_dir).decode("utf-8")
if git.is_dirty(mypy_dir):
__version__ += ".dirty"

@sobolevn sobolevn merged commit 1fab96b into master Jun 24, 2023
@sobolevn sobolevn deleted the sobolevn-patch-3 branch June 24, 2023 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants