msg240074 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2015-04-04 14:24 |
Proposed patch makes Argument Clinic to inline parsing code for most popular formats in functions with single positional argument. This makes parsing faster. |
|
|
msg264596 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-05-01 13:53 |
Synchronized with tip. |
|
|
msg264629 - (view) |
Author: Larry Hastings (larry) *  |
Date: 2016-05-02 06:51 |
Why is this dependent on #26305? |
|
|
msg264631 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-05-02 09:04 |
Because new generated code contains "if" statements and braces (and PEP 7 requires even more braces than current patch adds). The patch for allows to repeat braces only twice instead of 4 times. |
|
|
msg286788 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2017-02-02 13:50 |
I like the idea since I just proposed something similar in the issue #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. |
|
|
msg326979 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2018-10-03 14:54 |
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. |
|
|
msg327493 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2018-10-10 21:22 |
I'm a little bit sad that the PR doesn't add new tests :-( |
|
|
msg332507 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2018-12-25 11:23 |
New changeset 32d96a2b5bc3136d45a66adbdb45fac351b520ce by Serhiy Storchaka in branch 'master': bpo-23867: Argument Clinic: inline parsing code for a single positional parameter. (GH-9689) https://github.com/python/cpython/commit/32d96a2b5bc3136d45a66adbdb45fac351b520ce |
|
|
msg332511 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2018-12-25 14:57 |
See for next step. |
|
|
msg332978 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-01-04 13:52 |
Nice optimization! I wanted to implement it, but then I forgot. |
|
|