Content-Length: 288883 | pFad | https://github.com/python/cpython/pull/119805

90 [3.12] gh-109218: Improve documentation for the complex() constructor (GH-119687) by serhiy-storchaka · Pull Request #119805 · python/cpython · GitHub
Skip to content

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

Merged
serhiy-storchaka merged 1 commit intopython:3.12from
serhiy-storchaka:backport-ec1ba26-3.12
May 30, 2024
Merged

[3.12] gh-109218: Improve documentation for the complex() constructor (GH-119687)#119805
serhiy-storchaka merged 1 commit intopython:3.12from
serhiy-storchaka:backport-ec1ba26-3.12

Conversation

@serhiy-storchaka
Copy link
Copy Markdown
Member

@serhiy-storchaka serhiy-storchaka commented May 30, 2024

  • 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)

📚 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 commit ec1ba26)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
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.

1 participant









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/python/cpython/pull/119805

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy