homepage

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.

classification
Title: Make '%F' and float.__format__('F') convert results to upper case.
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.1, Python 2.7
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: eric.smith Nosy List: eric.smith, mark.dickinson
Priority: normal Keywords: easy, patch

Created on 2008年07月16日 18:28 by eric.smith, last changed 2022年04月11日 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue3382_trunk.patch mark.dickinson, 2009年11月29日 10:38
issue3382_trunk-1.patch eric.smith, 2009年11月29日 17:06
Messages (12)
msg69811 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2008年07月16日 18:28
See http://mail.python.org/pipermail/python-dev/2008-July/081242.html
for the discussion. Basically, 'F' did the same as 'f' because it was
assumed that neither would ever produce an exponent. But they do, for
numbers greater than about 1e50. Also, 'F' should produce 'NAN' for
cases where 'f' produces 'nan'.
msg69897 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2008年07月17日 18:35
Implemented for trunk in r65069; for py3k in r65073.
msg69901 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2008年07月17日 19:21
Changes backed out, pending fixing on Windows.
msg71945 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2008年08月25日 17:28
Unfortunately, I missed the window to get these into 3.0 and 2.6. 
Better luck for 3.1 and 2.7!
msg86838 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2009年04月30日 01:13
If http://bugs.python.org/issue5859 is implemented, then this issue
really just becomes making sure NAN and INF are uppercase.
msg87092 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2009年05月04日 00:58
With the implementation of issue5859 (py3k only), the only case where
this matters in NAN and INF. I'm going to address those in 3.1, and not
make any change for 2.x.
msg87330 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2009年05月06日 13:16
Checked in to py3k in 72398. I'm reconsidering whether to make this
change in 2.7. I might make the change there, I'll have to check on the
impacts.
msg95802 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009年11月29日 10:38
Eric, any further thoughts about making this change in 2.7? Here's a 
patch that does it (I think).
msg95805 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2009年11月29日 14:15
Thanks for looking at this, Mark.
Your patch looks okay to me, but Objects/stringlib/formatter.h still has
some 'F' -> 'f' logic in it, although it turns out that it's wrong:
#if PY_VERSION_HEX < 0x0301000
 /* 'F' is the same as 'f', per the PEP */
 /* This is no longer the case in 3.x */
 if (type == 'F')
 type = 'f';
#endif
Note that it's missing a zero on the end, so this code is never (and I
guess never was) executed. I'll remove it and add a test.
It also looks like complex is still mapping 'F' to 'f'. I'll fix that,
too, and add a test for it.
Thanks again.
msg95807 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2009年11月29日 17:06
Here's a patch which adds some tests and fixes complex.
I'm currently testing with PY_NO_SHORT_FLOAT_REPR on Windows. If that's
okay, and if you don't have any objections, I'll commit this. While I'm
at it I'll modify Objects/stringlib/formatter.h in py3k to keep them it
sync with trunk.
msg95808 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009年11月29日 17:12
Looks good to me.
msg95810 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2009年11月29日 17:41
Committed (with a few more tests) in r76583.
History
Date User Action Args
2022年04月11日 14:56:36adminsetgithub: 47632
2009年11月29日 17:41:25eric.smithsetstatus: open -> closed
resolution: accepted
messages: + msg95810

stage: resolved
2009年11月29日 17:12:13mark.dickinsonsetmessages: + msg95808
2009年11月29日 17:07:08eric.smithsetversions: + Python 2.7
2009年11月29日 17:06:56eric.smithsetfiles: + issue3382_trunk-1.patch

messages: + msg95807
2009年11月29日 14:15:04eric.smithsetmessages: + msg95805
2009年11月29日 10:38:58mark.dickinsonsetfiles: + issue3382_trunk.patch
keywords: + patch
messages: + msg95802
2009年05月06日 13:16:24eric.smithsetmessages: + msg87330
2009年05月04日 00:58:45eric.smithsetmessages: + msg87092
versions: - Python 2.7
2009年04月30日 01:13:37eric.smithsetmessages: + msg86838
2009年04月12日 16:26:22eric.smithsetnosy: + mark.dickinson
2008年08月25日 17:28:45eric.smithsetmessages: + msg71945
versions: + Python 3.1, Python 2.7, - Python 2.6, Python 3.0
2008年07月17日 19:21:37eric.smithsetstatus: closed -> open
resolution: accepted -> (no value)
messages: + msg69901
2008年07月17日 18:35:24eric.smithsetstatus: open -> closed
resolution: accepted
messages: + msg69897
2008年07月16日 18:28:14eric.smithcreate

AltStyle によって変換されたページ (->オリジナル) /