Skip to content

Add error code to typing_extensions suggestion #14881

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
Mar 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion mypy/semanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2616,11 +2616,14 @@ def report_missing_module_attribute(
typing_extensions = self.modules.get("typing_extensions")
if typing_extensions and source_id in typing_extensions.names:
self.msg.note(
f"Use `from typing_extensions import {source_id}` instead", context
f"Use `from typing_extensions import {source_id}` instead",
context,
code=codes.ATTR_DEFINED,
)
self.msg.note(
"See https://mypy.readthedocs.io/en/stable/runtime_troubles.html#using-new-additions-to-the-typing-module",
context,
code=codes.ATTR_DEFINED,
)

def process_import_over_existing_name(
Expand Down