gh-89381: Fix signature for math.log and cmath.log by hauntsaninja · Pull Request #101115 · python/cpython · GitHub
Skip to content

gh-89381: Fix signature for math.log and cmath.log - #101115

Closed
hauntsaninja wants to merge 2 commits into
python:mainfrom
hauntsaninja:gh-89381
Closed

hauntsaninja wants to merge 2 commits into
python:mainfrom
hauntsaninja:gh-89381

Conversation

@hauntsaninja

@hauntsaninja hauntsaninja commented Jan 18, 2023

Copy link
Copy Markdown
Contributor

The optional group in math.log seems unnecessary, as far as I can tell. Once we remove this, Argument Clinic knows what to do.

For cmath, we just do what math is already doing: use c_default = NULL (so the actual runtime logic is unchanged), but mark cmath.e as the fake default value.

The optional group in math.log seems unnecessary, as far as I can tell.
Once we remove this, Argument Clinic knows what to do.

For cmath, we just do what math is doing, which is use c_default = NULL
(so the actual runtime logic is unchanged), but mark cmath.e as the fake
default value.
@skirpichev

Copy link
Copy Markdown
Member

@mdickinson
mdickinson self-requested a review January 19, 2023 16:28
@mdickinson

Copy link
Copy Markdown
Member

Maybe this is slightly cryptic: 1) magic constant appear, 2) there is an illusion that the special base=math.e works internally as log(x)/log(base).

Agreed on both points; I prefer the solution in #101070.

@skirpichev

Copy link
Copy Markdown
Member

@mdickinson, I can restore #101070, if you wish. But after #101123 I'm not sure that a broken signature is an issue for CPython.

@mdickinson

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants