[Python] How does function arguments autocompletion work on Visual Studio Code?

Discussão em 'Python' iniciado por Stack, Maio 11, 2025.

  1. Stack

    Stack Membro Participativo

    I'm currently coding in python on Visual Studio Code, and using tkinter.

    I am wondering about autocompletion for function arguments, e.g.:

    [​IMG]

    What is responsible for it? I can think of either tkinter, Visual Studio Code, or Pylance (which is mentioned in similar autocompletion windows).

    I found this from autocompletion:

    from typing extensions import Literal

    # Ellipses stand for other annotated parameters
    def pack_configure(self, ..., side: Literal['left', 'right', 'top', 'bottom'], ...):
    ...


    I would like to enable autocompletion for some function arguments. Is autocompletion caused by Literal? If so, is it a good practice to use it in my functions?

    Continue reading...

Compartilhe esta Página