-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
builtins: Specify return type of int.__pow__ #2271
Conversation
The Any return type is intentional here because Union return types are generally annoying to deal with. This is mentioned in https://github.com/python/typeshed/blob/master/CONTRIBUTING.md#conventions. |
I don't really agree with that as the user always has the option to cast or just ignore Union return types and having specific types is the purpose of stub files but sorry for the fuss if it's common convention. Then again, that convention is not followed consistently. There are e.g. signatures for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please no. The Any was intentional. Otherwise mypy will prompt users for isinstance () checks even with n**2.
The union return types for |
There's absolutely no requirement for
|
All of those have the same problem as |
By the way, mypy already special cases type checking of |
No description provided.