-
Notifications
You must be signed in to change notification settings - Fork 186
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
[BUG] helpers.bulk action is incorrectly typed #154
Comments
Can you imagine a scenario where introducing this fix would break someone's already working code that relied on the old result typing? If so we'd need to keep track of which version we do this in, or maybe fix it in a way that couldn't break old code. |
I don't think there's a way you can depend on this that breaks with the proposed change. In the end adding overloads doesn't change anything when it comes to the existing code, the original function definition is still the same (just with an added @overload decorator) and it behaves exactly the same, but there is now additional information for the typing system in the form of the other 2 overloads which I've posted. If you imagine a diff for this change it would just be adding the above lines plus the @overload decorator for the actual implementation. |
This makes total sense. Feel free to submit a PR for this. |
@pejter Would you be up for submitting a PR for this? |
@saimedhi can you take a look? |
yes |
Is your feature request related to a problem?
When using helpers.bulk in a typed environment I need to manually cast the result to either tuple[int, int] or tuple[int, list[Any]] depending on the value of stats_only argument.
What solution would you like?
You can introduce overloads to the relevant functions which return different types depending on arguments like
helpers.bulk
The text was updated successfully, but these errors were encountered: