This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: For float.__format__, don't add a trailing ".0" if we're using no type code and we have an exponent
Type: behavior Stage:
Components: Interpreter Core Versions: Python 3.1, Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eric.smith Nosy List: eric.smith, mark.dickinson
Priority: normal Keywords: easy

Created on 2009-04-16 10:57 by eric.smith, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg86021 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2009-04-16 10:57
The point of the empty type code is to make sure a number looks like a
float (so as to avoid formatting 2.0 as "2"). But if we have an
exponent, the result already looks like a float, so there's no need to
modify the number further.
msg86022 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2009-04-16 11:09
For a more detailed discussion, scroll to the bottom of
msg86030 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-04-16 13:08
Just for the public record, I think that getting rid of the '.0' is the 
right thing to do here.
msg86042 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2009-04-16 20:52
Fixed in py3k (which will become 3.1) in r71665.
msg86299 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2009-04-22 14:49
Fixed in trunk as part of r71796. Closing the issue.
Date User Action Args
2022-04-11 14:56:47adminsetgithub: 50022
2009-04-22 14:49:48eric.smithsetstatus: open -> closed
resolution: fixed
messages: + msg86299
2009-04-16 20:52:47eric.smithsetmessages: + msg86042
2009-04-16 13:08:37mark.dickinsonsetmessages: + msg86030
2009-04-16 11:09:20eric.smithsetmessages: + msg86022
2009-04-16 10:57:20eric.smithcreate