-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Type Annotation in pandas/core/api.py #26148
Comments
@WillAyd I am little confused here, these attributes does not exists in |
Those objects are created dynamically at the end of that module (specifically inserted into |
I will try to figure out possible solutions. |
@WillAyd mypy doesn't runs the code, python/mypy#5719 (comment). Therefore Another possible solution(not sure it will work) I can think of is to define these attributes( |
I suppose it makes sense that the static type checker wouldn't be able to detect these objects created at runtime. Though more verbose I think explicitly listing out these types as part of the module would be preferable |
So get rid of the loop which is dynamically creating these integer type and create all integer types one by one? |
@WillAyd how do list types as part of module? |
@WillAyd instead of:
We can do this 👇
But we will have to do this 8 times for all integer types. Sorry I was busy for last few days and forgot about this. |
Thanks @vaibhavhrt - yes I think that would be fine. More verbose but would enable static analysis on those objects so I think worth the tradeoff |
Part of #25882
Current errors are:
The text was updated successfully, but these errors were encountered: