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

[3.12] gh-109218: Improve documentation for the complex() constructor (GH-119687)#119805

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

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedMay 30, 2024
edited by github-actionsbot
Loading

  • Remove the equivalence with real+imag*1j which can be incorrect in corner cases (non-finite numbers, the sign of zeroes).
  • Separately document the three roles of the constructor: parsing a string, converting a number, and constructing a complex from components.
  • Document positional-only parameters of complex(), float(), int() and bool() as positional-only.
  • Add examples for complex() and int().
  • Specify the grammar of the string for complex().
  • Improve the grammar of the string for float().
  • Describe more explicitly the behavior when real and/or imag arguments are complex numbers. (This will be deprecated in future.) (cherry picked from commitec1ba26)

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

…ructor (pythonGH-119687)* Remove the equivalence with real+imag*1j which can be incorrect in corner  cases (non-finite numbers, the sign of zeroes).* Separately document the three roles of the constructor: parsing a string,  converting a number, and constructing a complex from components.* Document positional-only parameters of complex(), float(), int() and bool()  as positional-only.* Add examples for complex() and int().* Specify the grammar of the string for complex().* Improve the grammar of the string for float().* Describe more explicitly the behavior when real and/or imag arguments are  complex numbers. (This will be deprecated in future.)(cherry picked from commitec1ba26)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@serhiy-storchakaserhiy-storchakaenabled auto-merge (squash)May 30, 2024 20:27
@serhiy-storchakaserhiy-storchaka merged commit207d1b0 intopython:3.12May 30, 2024
30 checks passed
@serhiy-storchakaserhiy-storchaka deleted the backport-ec1ba26-3.12 branchOctober 21, 2024 13:45
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@serhiy-storchaka

[8]ページ先頭

©2009-2025 Movatter.jp