-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
invalid signature for math.hypot #101123
Comments
We don't have a rule that all docstrings have to be in a format edible by inspect? There are many docstrings that don't. This is just a simple |
@rhettinger, could you explain a bit more what it does break? Here is how new docstring looks (just like other similar functions in the module, e.g. gcd and lcm, and how the rst docs for the hypot looks too):
Here is the old:
|
FYI: AC stuff is fast with #30312. |
@rhettinger, I'll reopen this as a feature request. AC now supports *args processing, but it's coming with a slight performance penalty. One can be mitigated, using approach from #90370; I'm working on patch. With this, gcd/lcm could be converted to AC too (now these functions use "funky looking text_signature notation" (c) in docstrings). |
Current patch partially address issue, working in case when all arguments either positional-only or vararg. This also converts gcd(), lcm() and hypot() functions of the math module to the Argument Clinic. Fix issue python#101123. Objects/setobject.c and Modules/gcmodule.c adapted. This fixes slight performance regression for set methods, introduced by python#115112: | Benchmark | ref | patch | |----------------------|:------:|:--------------------:| | set().update(s1, s2) | 354 ns | 264 ns: 1.34x faster | Benchmark code: ```py import pyperf s1, s2 = {1}, {2} runner = pyperf.Runner() runner.bench_func('set().update(s1, s2)', set().update, s1, s2) ```
…ic (#126235) This implicitly fixes the math.hypot signature, which was previously incomprehensible to inspect.signature().
…t Clinic (python#126235) This implicitly fixes the math.hypot signature, which was previously incomprehensible to inspect.signature().
…t Clinic (python#126235) This implicitly fixes the math.hypot signature, which was previously incomprehensible to inspect.signature().
This patch works:
Linked PRs
The text was updated successfully, but these errors were encountered: