Improved the type stubs in the _libs directory to help with type checking
This doesn't change any code, so it should have no impact on runtime behavior.
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. @erictraut If you don't have time for this PR, I wouldn't mind forking your branch, rebasing it, and making adjustments to get it merged (after #43828 is merged).

Out of curiosity: Did pyright generate the type annotations in this PR or are they from Microsoft's pandas type stubs? @twoertwein, thanks for offering. Yeah, I'd appreciate it if you'd take over this PR. Addressing its issues involved more complexity than I anticipated.

These type annotations are based on Microsoft's pandas type stubs plus some additional hand-written signatures. They weren't auto-generated by pyright. pls rebase > pls rebase

I think this PR could be closed (but please don't delete the fork). I cherry-pick parts of this PR into more manageable portions. closing as per @twoertwein comment https://github.com/pandas-dev/pandas/pull/43744#issuecomment-996185887