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.
Created on 2008年03月10日 11:05 by eric.smith, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg63438 - (view) | Author: Eric V. Smith (eric.smith) * (Python committer) | Date: 2008年03月10日 11:05 | |
PEP 3101 specifies that the empty format presentation type for float will always print at least one digit after the decimal point, but it does not do that if the number is output with an exponent: works: >>> format(3.0, '') '3.0' fails: >>> format(3e200, '') '3e+200' As currently implemented, the code just maps the empty format specifier to 'g', and does not add the additional behavior specfied in the PEP. |
|||
| msg63614 - (view) | Author: Eric V. Smith (eric.smith) * (Python committer) | Date: 2008年03月17日 03:06 | |
I think the best way to handle this is to add a new format code to PyOS_ascii_formatd, which implements this behavior. There can be no backward compatibility issues, because PyOS_ascii_formatd currently ensures its format specifier type code is in ['e', 'E', 'f', 'F', 'g', 'G', 'n']. I'm going to use 'Z' (for lack of a better code) to mean "implement the default behavior from PEP 3101". |
|||
| msg63632 - (view) | Author: Eric V. Smith (eric.smith) * (Python committer) | Date: 2008年03月17日 11:02 | |
Fixed checked in as r61434. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:31 | admin | set | github: 46517 |
| 2008年03月17日 11:02:27 | eric.smith | set | status: open -> closed resolution: fixed messages: + msg63632 |
| 2008年03月17日 03:06:53 | eric.smith | set | messages: + msg63614 |
| 2008年03月10日 11:05:23 | eric.smith | create | |