I see the type hints from VS Code but I don't understand where they are defined in the code in Github

Hi everyone, sorry for the dumb question, if I move the mouse over ListedColormap from VS Code I see that “colors” has as type ArrayLike | Sequence[_ColorLike], but I can’t understand where it is defined in the matplotlib code in GitHub, can you help me?

Those hints are provided by vscode not by us.

1 Like

Oh wow, I didn’t know VS Code started doing that, thanks for the answer!

The source of those hints is:

GitHub - microsoft/python-type-stubs: A set of type stubs for popular Python packages. These are works in progress from the Microsoft Python team and others, with the intent that they are contributed to typeshed or to the associated packages once sufficiently complete.

1 Like

Ooh great thanks! I will check there then, very useful