Skip to content

python version checks don't seem to work with 0.780 #8990

Closed
@samuelcolvin

Description

@samuelcolvin

Upgrading to mypy 0.780 from 0.770, I can't find a way to get the following lines to pass with both python 3.6 and 3.7.

If I try ignoring different lines with # type: ignore I get either errors or unused 'type: ignore' comment from one version of python or the other.

if sys.version_info < (3, 7):
    from typing import _ForwardRef as ForwardRef
else:
    from typing import ForwardRef

Is this a problem with 0.780 or am I doing something wrong.

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