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
Argument Clinic: inline parsing code for 1-argument functions #68055
Comments
Proposed patch makes Argument Clinic to inline parsing code for most popular formats in functions with single positional argument. This makes parsing faster. |
Synchronized with tip. |
Why is this dependent on bpo-26305? |
I like the idea since I just proposed something similar in the issue bpo-29419, but it seems like your change removes the function name from error messages which can become much more obscure. Maybe we should wrap all exceptions into a new TypeError which contains at least the function name, or even the parameter name/position. I mean chained exception to keep the original exception which contains more information. The best would be to have all information in a single error message, but it is likely to be much more complex to implement, especially if you want to support arbitrary converter function, not only simple formats like i". So I think that two chained exceptions is a reasonable compromise. What do you think? If we succeed to get the function name and the parameter name or position, the error messages will be MUCH MORE better than currently! And Argument Clinic allows us to implement this feature. |
Thank you all for your comments. Addressed all comments, fixed few other bugs, added support for more convertors. I think this patch is completed. This is just a first step. Next steps are adding support of multiple positional-only parameters, optional groups, and finally keyword parameters. |
I'm a little bit sad that the PR doesn't add new tests :-( |
See bpo-35582 for next step. |
Nice optimization! I wanted to implement it, but then I forgot. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: