Issue 5772: For float.format, don't add a trailing ".0" if we're using no type code and we have an exponent (original) (raw)
Issue5772
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.
This issue has been migrated to GitHub: https://github.com/python/cpython/issues/50022
classification
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 |
process
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) * ![]() |
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) * ![]() |
Date: 2009-04-16 11:09 |
For a more detailed discussion, scroll to the bottom of http://mail.python.org/pipermail/python-dev/2009-April/088417.html | ||
msg86030 - (view) | Author: Mark Dickinson (mark.dickinson) * ![]() |
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) * ![]() |
Date: 2009-04-16 20:52 |
Fixed in py3k (which will become 3.1) in r71665. | ||
msg86299 - (view) | Author: Eric V. Smith (eric.smith) * ![]() |
Date: 2009-04-22 14:49 |
Fixed in trunk as part of r71796. Closing the issue. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:56:47 | admin | set | github: 50022 |
2009-04-22 14:49:48 | eric.smith | set | status: open -> closedresolution: fixedmessages: + |
2009-04-16 20:52:47 | eric.smith | set | messages: + |
2009-04-16 13:08:37 | mark.dickinson | set | messages: + |
2009-04-16 11:09:20 | eric.smith | set | messages: + |
2009-04-16 10:57:20 | eric.smith | create |