Hi Irv,

I am not very familiar with the typing space so some questions below.

Can you explain a bit more what would be the consequence of the type annotations in pandas itself? I suppose we wouldn't remove those? (we also have type annotations for non-public APIs) Or how would those be kept in sync?

Another question: what is the main advantage for doing so? I suppose this doesn't make it necessarily easier for the user, but is the goal the make the type stubs better maintainable?
Would the type-stubs package be for a specific pandas version (and get somewhat synced releases?)

Joris

On Tue, 23 Nov 2021 at 17:22, Irv Lustig <irv@princeton.com> wrote:
I discovered this feature of typing:
https://www.python.org/dev/peps/pep-0561/#stub-only-packages

The idea is that for a package like pandas, we can have a separate package "pandas-stubs" that would contain the type stubs for pandas.  We wouldn't have to worry about including a `py.typed` file or `.pyi` files in our standard pandas distribution - all typing for the public API would be in the separate package.  That would allow pandas typing for the public API to be maintained separately (different GitHub repo).  We could start by just copying over what Microsoft created at https://github.com/microsoft/python-type-stubs/tree/main/pandas and then we maintain it as a separate repo, which could be installed via pip and conda.

Any thoughts on whether we should consider doing this?

-Irv

_______________________________________________
Pandas-dev mailing list
Pandas-dev@python.org
https://mail.python.org/mailman/listinfo/pandas-dev