How to disable linting in code editor for error "type annotation" visual studio code python

Issue

what in the problem.

code editor

how i can fix it? I’m trying:

1)disable liting

2)turn all reports to "none" in python.analysis.diagnosticSeverityOverrides

settings.json

I don’t understand what else can I do to make this error go away ;-;

Solution

You can use the typing module to achieve this:

from typing import Tuple

def test(x, y: Tuple(tuple, list)):
    # do some things
    return

or without the module like this:

def test(x, y: tuple(tuple, list)):
    # do some things
    return

Answered By – D.L

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published