You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add more tests for formatting floats and fractions #109546
File "formatfloat_testcases.txt" contains test cases for testing printf-like formatting of floats. The same data can be used for testing new-style formatting of floats (they give the same result) and float-style formatting of Fraction (added in 3.12).
I tried also to use this file in test_decimal, but decimals produce very different output.
I am not sure about test_complex. On one hand, complex formatting uses the same PyOS_double_to_string() as float formatting. On other hand, there is a code between __format__() and PyOS_double_to_string() which can affect interpretation of the format string.
Activity
pythongh-109546: Add more tests for formatting floats and fractions
gh-109546: Add more tests for formatting floats and fractions (GH-109548
pythongh-109546: Add more tests for formatting floats and fractions (p…
serhiy-storchaka commentedon Sep 19, 2023
I tried also to use this file in
test_decimal, but decimals produce very different output.I am not sure about
test_complex. On one hand, complex formatting uses the samePyOS_double_to_string()as float formatting. On other hand, there is a code between__format__()andPyOS_double_to_string()which can affect interpretation of the format string.vstinner commentedon Sep 19, 2023
It's already great to use it in test_fractions! And that you added more tests in test_float.
pythongh-109546: Add more tests for formatting floats (pythonGH-109548)
[3.11] gh-109546: Add more tests for formatting floats (GH-109548) (#…
pythongh-109546: Add more tests for formatting floats and fractions (p…
[3.12] gh-109546: Add more tests for formatting floats and fractions (G…