At the company I'm working we use type annotation to define the expected return type from a function. Most developers are using PyCharm but I prefer to stick with VS Code.
The following line in the VS Code IDE:
def example() -> [str]:
Raises a Pylance warning:
List expression not allowed in type annotation
Use List[T] to indicate a list type or Union[T1, T2] to indicate a union typePylance
And would like me to use:
def example() -> List[str]
Although fixing this would require me to go over the whole code base and won't be accepted for a pull request. As I can live with this warning, I would like to suppress it.