Pyright ... (triple dot) is not allowed in this context

74 views Asked by At

I am on python 3.11 and i am using type hints for annotations. I have a function parameter which takes list of any length, all elements should of type str, for this when I do the following:

def create_input(columns: list[str, ...]):

    ...

Pyright throws an error in the editor saying triple dots are allowed in this context. But in the docs, it says it is okay. See image for reference. And docs

enter image description here

Could some one please help, what I am doing wrong?

0

There are 0 answers