Skip to content

Types from the typing module that don't exist in the specified Python version are not detected by Mypy #6593

Closed

Description

@matl876

Hello there,

I think this is not the desired behaviour of Mypy. If I set the version of Python to 3.5, it doesn't report Deque imports, even though this type only appeared in Python 3.6.

mypy.ini:

[mypy]
python_version = 3.5

The python code:

from typing import Deque

...

This does not report any errors with mypy 0.670.

Activity

  1. gvanrossum commented on Mar 26, 2019

    @gvanrossum
    Member

    Thanks for reporting! But it's not a flaw in mypy itself, it's in typeshed, which has a separate repo: https://github.com/python/typeshed. Please report it there!

  2. ilevkivskyi commented on Apr 1, 2019

    @ilevkivskyi
    Member

    These type aliases (Deque etc) are added dynamically by mypy for subtle reasons, so this can't be fixed in typeshed. I think we can track this as part of #3413 (although it is not the same issue, the two should be probably fixed together).

  3. gvanrossum commented on Apr 1, 2019

    @gvanrossum
    Member

    OK, reopening.

  4. AlexWaygood commented on Mar 26, 2022

    @AlexWaygood
    Member

    Python 3.5 is no longer supported by mypy, and I can't reproduce this with any other aliases, so I'm closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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