basedmypy icon indicating copy to clipboard operation
basedmypy copied to clipboard

`unsafe-variance` error code is actually `misc`

Open DetachHead opened this issue 3 years ago • 2 comments

Describe the problem, ie expected/actual result (if it's not blatantly obvious)

test.py:21:26: error: This usage of this covariant type variable is unsafe as an input parameter.
If this is intentional and you know what you are doing, you can ignore
this line with 'unsafe-variance'  [misc]
        def foo(self, value: T_co):  # type:ignore[unsafe-variance]
                             ^
test.py:21:26: note: Error code "misc" not covered by "type: ignore" comment
Found 2 errors in 1 file (checked 1 source file)

Gist to reproduce

from typing import Generic

from basedtyping import T_co


class Foo(Generic[T_co]):
    def foo(self, value: T_co):  # type:ignore[unsafe-variance]
        ...

Basedmypy version

1.4.0

Command-line flags

No response

Configuration options from pyproject.toml (and other config files)

No response

Python version used

3.10

Operating system and version

windows 10

DetachHead avatar Jul 20 '22 04:07 DetachHead

what the

KotlinIsland avatar Jul 20 '22 05:07 KotlinIsland

This is a regression caused by upstream changes and lack of tests

KotlinIsland avatar Jul 20 '22 05:07 KotlinIsland