intellij-micropython icon indicating copy to clipboard operation
intellij-micropython copied to clipboard

How do you type hint builtins?

Open hlovatt opened this issue 3 years ago • 1 comments

I've generated typesheds (pyi) from Micropython docs, See https://github.com/hlovatt/PyBoardTypeshed, and issued a pull request so that they will hopefully become part of the plugin.

But what do about builtins.pyi?

If I generate a builtins.pyi file, where do I put it?

It doesn't seem to work if I put it in stdlib!

hlovatt avatar Oct 17 '21 03:10 hlovatt

AFAIK there is no way to do it other than builtins.pyi, but builtins.pyi already exist in the base set of stubs from Typeshed that PyCharm uses for your Python interpreter. One workaround might be to hard-code it via the code insight API of PyCharm, but having them written down declaratively in stub files seems better. I'm not sure at this point how to override builtins.pyi from Typeshed.

vlasovskikh avatar Dec 01 '21 00:12 vlasovskikh