Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-133895: provide C99 Annex G return values for cmath's functions#134995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
skirpichev wants to merge14 commits intopython:main
base:main
Choose a base branch
Loading
fromskirpichev:cmath-ValueError/133895

Conversation

skirpichev
Copy link
Contributor

@skirpichevskirpichev commentedJun 1, 2025
edited
Loading

Now this information is available as the "value" attribute of raised exception objects, for example:

>>>import cmath>>>try:...     cmath.log(complex(-0.0,0))...exceptValueErroras exc:...print(exc.value)...(-inf+3.141592653589793j)

Also uses the AC magic for return value of the cmath.rect().


📚 Documentation preview 📚:https://cpython-previews--134995.org.readthedocs.build/

Now this information is available as the "value" attributeof the ValueError exception object:```pycon>>> import cmath>>> try:...     cmath.log(complex(-0.0, 0))... except ValueError as exc:...     print(exc.value)...(-inf+3.141592653589793j)```Also uses the AC magic for return value of the cmath.rect().
@skirpichev
Copy link
ContributorAuthor

CC@abhigyan631 as author of#133923

@skirpichevskirpichev changed the titlegh-133895: provide C99 Annex G return values for cmath functionsgh-133895: provide C99 Annex G return values for cmath's functionsJun 1, 2025
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@skirpichevskirpichev marked this pull request as draftJune 2, 2025 09:06
@skirpichevskirpichev marked this pull request as ready for reviewJune 5, 2025 04:40
@skirpichev
Copy link
ContributorAuthor

skirpichev commentedJun 5, 2025
edited
Loading

I changed exception handling along the way, suggested by@serhiy-storchaka. I hope I did that right. If so, I can adjust the math's pr.

Now we addvalue to OverflowError's too. This reveals two bugs (in sinh and cosh), fixed.

@skirpichevskirpichev requested a review frompicnixzJune 5, 2025 05:06
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@serhiy-storchakaserhiy-storchakaAwaiting requested review from serhiy-storchaka

@picnixzpicnixzAwaiting requested review from picnixz

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@skirpichev@serhiy-storchaka@picnixz

[8]ページ先頭

©2009-2025 Movatter.jp