Skip to content

Incompatible import of "Literal" (imported name has type "typing_extensions._SpecialForm", local name has type "typing._SpecialForm") #8520

@hackaugusto

Description

@hackaugusto

Please provide more information to help us understand the issue:

  • Are you reporting a bug, or opening a feature request?

Bug

  • Please insert below the code you are checking with mypy,
    or a mock-up repro if the source is private. We would appreciate
    if you try to simplify your case to a minimal repro.
from typing import Literal
from typing_extensions import Literal
  • What is the actual behavior/output?

No conflicts among the types

  • What is the behavior/output you expect?
t.py:3: error: Incompatible import of "Literal" (imported name has type "typing_extensions._SpecialForm", local name has type "typing._SpecialForm")
Found 1 error in 1 file (checked 1 source file)
  • What are the versions of mypy and Python you are using?
    Do you see the same issue after installing mypy from Git master?

Python 3.8.1
mypy 0.761
mypy 0.770+dev.a0c5dfc88fa8780db8a3cf7b76c32e4257f218e2
mypy-extensions==0.4.3
typing-extensions==3.7.4.1

  • What are the mypy flags you are using? (For example --strict-optional)

None

  • If mypy crashed with a traceback, please paste
    the full traceback below.

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions