I often use pandas type annotations found in the _typing
module: FrameOrSeries
, FrameOrSeriesUnion
, ...
It feels a bit weird to import stuff from a private module though. Would it make sense to expose some annotations in a typing.py
module?
API breaking implications
I wouldn't expect any, typing.py
could be an additional module that imports from _typing.py
Describe alternatives you've considered
Alternatively, annotations could be added to the main __init__.py
so they can be imported with pandas.*
.
Comment From: rohitkg98
Creating a typing module sounds good, similar to what is done with _testing.py
, I can take it up and make a PR
Comment From: jreback
we purposely made _typing.py private
at some point we could have a public typing which would import some of these
Comment From: simonjayhawkins
use https://github.com/pandas-dev/pandas-stubs