Skip to content

Deprecate several things in mypy_extensions #13874

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
Apr 23, 2025
Merged

Conversation

sobolevn
Copy link
Member

See python/mypy_extensions@1.0.0...1.1.0 on what was deprecated.

@hauntsaninja hauntsaninja merged commit 65860e5 into main Apr 23, 2025
42 checks passed
@hauntsaninja hauntsaninja deleted the sobolevn-patch-1 branch April 23, 2025 22:37
@@ -37,6 +38,7 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta):
# supposedly incompatible definitions of `__or__` and `__ior__`:
def __ior__(self, value: Self, /) -> Self: ... # type: ignore[misc]

@deprecated("mypy_extensions.TypedDict is deprecated, use typing.TypedDict instead")
Copy link
Member

Choose a reason for hiding this comment

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

I think a better message here would have been

Suggested change
@deprecated("mypy_extensions.TypedDict is deprecated, use typing.TypedDict instead")
@deprecated("Use typing.TypedDict or typing_extensions.TypedDict instead")

Both mypy and pyright include the phrase "X is deprecated" in their error message even if it's not included in the string passed to @deprecated, so I think we should generally avoid saying "X is deprecated" in these messages. We'll just be repeating things the type checker is already saying:

Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

vision (https://github.com/pytorch/vision)
- torchvision/utils.py:270: error: Unused "type: ignore" comment  [unused-ignore]

@sobolevn
Copy link
Member Author

I opened #13876

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.

3 participants