[issue26241] repr() and str() are identical for floats in 3.5

2016-01-30 Thread Anders Rundgren
New submission from Anders Rundgren: According to the documentation repr() and str() are different when it comes to number formatting. A test with a 100 million random and selected IEEE 64-bit values returned no differences -- components: Interpreter Core messages: 259244 nosy:

[issue26241] repr() and str() are identical for floats in 3.5

2016-01-30 Thread SilentGhost
SilentGhost added the comment: Would you mind linking to the relevant part of documentation? -- nosy: +SilentGhost ___ Python tracker ___

[issue26241] repr() and str() are identical for floats in 3.5

2016-01-30 Thread Eryk Sun
Eryk Sun added the comment: > A test with a 100 million random and selected IEEE 64-bit values > returned no differences The float type's tp_str and tp_repr both call float_repr in Objects/floatobject.c. See the 3.5.1 PyFloat_Type definition [1]. Perhaps you were reading something in

[issue26241] repr() and str() are identical for floats in 3.5

2016-01-30 Thread Mark Dickinson
Mark Dickinson added the comment: Closing: as Martin pointed out, the behaviour is intentional, and without a reference to a particular part of the documentation this issue isn't useful. (Anders: if you find a part of the 3.5 documentation that does state that str and repr are different for

[issue26241] repr() and str() are identical for floats in 3.5

2016-01-30 Thread Anders Rundgren
Anders Rundgren added the comment: Apparently the docs have changed since 2.7: https://docs.python.org/3.5/tutorial/floatingpoint.html However, the documentation still "sort of" mentions repr() as the most accurate form which isn't entirely correct since it nowadays is identical to str() for

[issue26241] repr() and str() are identical for floats in 3.5

2016-01-30 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___