Remove ABC Usage from pandas._typing #27146
Labels
Needs Discussion
Requires discussion from core team before further action
Typing
type annotations, mypy/pyright type checking
Milestone
Right now we use the ABC classes in pandas._typing to work around circular imports, but I think this has the effect of making our type checking practically non-existent. The ABCs are factory generated by an unannotated function, so they get replaced with
Any
To illustrate, run mypy on a module with this content
Mypy runs without issue yielding
By contrast, using the actual DataFrame class:
Yields an error:
I'm not sure the best approach here. Direct imports into pandas._typing should cause circular imports but the ABCs won't provide anything with type checking as long as they are factory generated.
The text was updated successfully, but these errors were encountered: