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
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 *args* function and I would rather not garbage-up the docstring with the funky looking text_signature notation.
This is just a simple args function and I would rather not garbage-up the docstring with the funky looking text_signature notation.
@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):
>>> help(math.hypot)
Help on built-in function hypot in module math:
hypot(*coordinates)
Multidimensional Euclidean distance from the origin to a point.
Roughly equivalent to:
sqrt(sum(x**2 for x in coordinates))
For a two dimensional point (x, y), gives the hypotenuse
using the Pythagorean theorem: sqrt(x*x + y*y).
For example, the hypotenuse of a 3/4/5 right triangle is:
>>> hypot(3.0, 4.0)
5.0
Here is the old:
>>> help(math.hypot)
Help on built-in function hypot in module math:
hypot(...)
hypot(*coordinates) -> value
Multidimensional Euclidean distance from the origin to a point.
Roughly equivalent to:
sqrt(sum(x**2 for x in coordinates))
For a two dimensional point (x, y), gives the hypotenuse
using the Pythagorean theorem: sqrt(x*x + y*y).
For example, the hypotenuse of a 3/4/5 right triangle is:
>>> hypot(3.0, 4.0)
5.0
@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).
Activity
rhettinger commentedon Jan 19, 2023
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
*args*function and I would rather not garbage-up the docstring with the funky looking text_signature notation.skirpichev commentedon Jan 19, 2023
@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:
skirpichev commentedon Feb 8, 2023
FYI: AC stuff is fast with #30312.
skirpichev commentedon Oct 27, 2024
@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).
pythongh-90370: avoid temporary tuple creation for vararg in AC
skirpichev commentedon Oct 28, 2024
#126064 should fix thispr is ready: #126235
pythongh-101123: convert vararg functions in the math module to AC
gh-101123: Adapt vararg functions in the math module to Argument Clin…
pythongh-101123: Adapt vararg functions in the math module to Argumen…
pythongh-101123: Adapt vararg functions in the math module to Argumen…