Skip to content

C API: Consider adding a public PyLong_GCD() function #111139

@vstinner

Description

@vstinner

Feature or enhancement

The private _PyLong_GCD() function was removed in Python 3.13: see PR #108429.

@scoder asked what is the intended replacement for _PyLong_GCD(). I suppose that the replacement is to call math.gcd().

Is it worth it to add a public PyLong_GCD() function to the C API? Is it commonly used?

A code search for _PyLong_GCD is PyPI top 5,000 projects found 0 projects using it.

@scoder: What is your use case for _PyLong_GCD()? Using math.gcd() doesn't solve your use case?

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions