Skip to content

unsafe-variance error code is actually misc #353

@DetachHead

Description

@DetachHead

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions