Skip to content

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

Merged
serhiy-storchaka merged 1 commit into
python:3.13from
miss-islington:backport-ec1ba26-3.13
May 30, 2024
Merged

[3.13] gh-109218: Improve documentation for the complex() constructor (GH-119687)#119803
serhiy-storchaka merged 1 commit into
python:3.13from
miss-islington:backport-ec1ba26-3.13

Conversation

@miss-islington

@miss-islingtonmiss-islington commented May 30, 2024

Copy link
Copy Markdown
Contributor
  • 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 commit ec1ba26)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com


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

…ythonGH-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 commit ec1ba26)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@miss-islington@serhiy-storchaka