Message362343
@Ananthakrishnan: Sure, go ahead.
Let's make the process a bit more streamlined than last time around: see if you can put together a PR that passes all the CI checks before asking for review. If you get stuck, make a work-in-progress PR and ask for help in a comment on that PR rather than via email.
A couple of pointers:
- Take a look at the existing math.hypot implementation to see how to deal with multiple arguments. (Note that argument clinic doesn't currently work for *args functions.)
- For the first working version, don't bother making special cases for the zero-argument or one-argument gcd (or even the case of two arguments). You just want the equivalent of the following Python code, which is perfectly general:
def gcd(*args):
g = 0
for arg in args:
g = gcd_2arg(g, operator.index(arg))
return g
where gcd_2arg is the original 2-argument gcd (in C, _PyLong_GCD). We can always optimise later. |
|
Date |
User |
Action |
Args |
2020-02-20 18:49:36 | mark.dickinson | set | recipients:
+ mark.dickinson, tim.peters, rhettinger, steven.daprano, SilentGhost, serhiy.storchaka, Dennis Sweeney, Ananthakrishnan, BernardoSulzbach |
2020-02-20 18:49:36 | mark.dickinson | set | messageid: <1582224576.03.0.913229484536.issue39648@roundup.psfhosted.org> |
2020-02-20 18:49:36 | mark.dickinson | link | issue39648 messages |
2020-02-20 18:49:35 | mark.dickinson | create | |
|