Mark Dickinson <[email protected]> added the comment:
@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.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue39648>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com