You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int.__round__ was not converted to Argument Clinic because it is not impossible to express a correct signature for it in Python. But now we can at least make Argument Clinic not producing incorrect signature. And converting to Argument Clinic has a performance benefit.
I don't have an opinion on the PR but want to point-out the Argument Clinic itself doesn't provide a performance benefit. Anything that it does can also be done directly by the code itself, including vectorcall logic. You should be able to optimize the function calls without using the Argument Clinic.
That said, it would be great if someone were to work on building-out AC to support more interesting argument patterns like those in round(). Ideally, AC would provide complete, correct support right out of the box.
Yes, you can do this without Argument Clinic, but Argument Clinic allows to hide the use of unstable private API and cumbersome code under macros and in generated files.
That said, it would be great if someone were to work on building-out AC to support more interesting argument patterns like those in round().
The problem is not only in Argument Clinic (and the Argument Clinic part is mainly solved). The problem is that currently it is not possible to express the signature of int.__round__() (and dict.get(), and getattr()) in Python syntax, and the inspect module does not support any non-Python syntax for this either. Once we invent the way to express it, supporting it in Argument Clinic will be merely technical problem.