Re: [Python-Dev] PEP 3101: floats format 'f' and 'F'

2008-07-17 Thread Eric Smith
Thomas Heller wrote: Guido van Rossum schrieb: On Thu, Jul 17, 2008 at 9:25 AM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: From: "Eric Smith" <[EMAIL PROTECTED]> I have this ready for checkin (with docs and tests). I'd like to get it in for this beta, since it does involved changed behavior

Re: [Python-Dev] PEP 3101: floats format 'f' and 'F'

2008-07-17 Thread Thomas Heller
Guido van Rossum schrieb: > On Thu, Jul 17, 2008 at 9:25 AM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: >> From: "Eric Smith" <[EMAIL PROTECTED]> >>> >>> I have this ready for checkin (with docs and tests). I'd like to get it >>> in for this beta, since it does involved changed behavior, no matt

Re: [Python-Dev] PEP 3101: floats format 'f' and 'F'

2008-07-17 Thread Guido van Rossum
On Thu, Jul 17, 2008 at 9:25 AM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > From: "Eric Smith" <[EMAIL PROTECTED]> >> >> I have this ready for checkin (with docs and tests). I'd like to get it >> in for this beta, since it does involved changed behavior, no matter how >> small ('1e+100' become

Re: [Python-Dev] PEP 3101: floats format 'f' and 'F'

2008-07-17 Thread Raymond Hettinger
From: "Eric Smith" <[EMAIL PROTECTED]> I have this ready for checkin (with docs and tests). I'd like to get it in for this beta, since it does involved changed behavior, no matter how small ('1e+100' becomes '1E+100' with '%F'). But it relies on the platform's vsnprintf to do the right thing wi

Re: [Python-Dev] PEP 3101: floats format 'f' and 'F'

2008-07-17 Thread Eric Smith
Eric Smith wrote: Guido van Rossum wrote: It shares code with %-formatting. Change that, too? I couldn't find any occurrences of %F in the stdlib. Not that that's the entire universe, of course. The change is slightly less elegant if I don't change %-formatting, but still doable, especial

Re: [Python-Dev] PEP 3101: floats format 'f' and 'F'

2008-07-16 Thread Guido van Rossum
On Wed, Jul 16, 2008 at 7:52 PM, Eric Smith <[EMAIL PROTECTED]> wrote: > Mark Dickinson wrote: >> >> On Wed, Jul 16, 2008 at 4:15 PM, Eric Smith >> <[EMAIL PROTECTED]> wrote: >>> >>> There's no exponent until the number gets large. I haven't looked up how >>> big the number has to get. On my Mac,

Re: [Python-Dev] PEP 3101: floats format 'f' and 'F'

2008-07-16 Thread Eric Smith
Mark Dickinson wrote: On Wed, Jul 16, 2008 at 4:15 PM, Eric Smith <[EMAIL PROTECTED]> wrote: There's no exponent until the number gets large. I haven't looked up how big the number has to get. On my Mac, it's somewhere between 1e50 and 1e60. I think it's around 1e50, courtesy of the rather o

Re: [Python-Dev] PEP 3101: floats format 'f' and 'F'

2008-07-16 Thread Eric Smith
Guido van Rossum wrote: It shares code with %-formatting. Change that, too? I couldn't find any occurrences of %F in the stdlib. Not that that's the entire universe, of course. The change is slightly less elegant if I don't change %-formatting, but still doable, especially if the betas don't

Re: [Python-Dev] PEP 3101: floats format 'f' and 'F'

2008-07-16 Thread Tim Peters
[Guido] > My best guess as to why 'F' is the same as 'f' is that somebody > (could've been me :-) thought, like several others in this thread, > that %f never prints an exponent. I agree that making it emit an 'E' > when an exponent is used is the right thing to do. Do it now! The C standard doesn

Re: [Python-Dev] PEP 3101: floats format 'f' and 'F'

2008-07-16 Thread Guido van Rossum
On Wed, Jul 16, 2008 at 10:30 AM, Eric Smith <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: >> >> On Wed, Jul 16, 2008 at 7:35 AM, Eric Smith >> <[EMAIL PROTECTED]> wrote: >>> >>> Does anyone know why 'F' is the same as 'f'? Wouldn't it make more sense >>> to >>> either drop it, or make it c

Re: [Python-Dev] PEP 3101: floats format 'f' and 'F'

2008-07-16 Thread Eric Smith
Guido van Rossum wrote: On Wed, Jul 16, 2008 at 7:35 AM, Eric Smith <[EMAIL PROTECTED]> wrote: Does anyone know why 'F' is the same as 'f'? Wouldn't it make more sense to either drop it, or make it convert the exponent to upper case (like 'E' and 'G')? Compatibility with %-formatting is the on

Re: [Python-Dev] PEP 3101: floats format 'f' and 'F'

2008-07-16 Thread Guido van Rossum
On Wed, Jul 16, 2008 at 7:35 AM, Eric Smith <[EMAIL PROTECTED]> wrote: > Does anyone know why 'F' is the same as 'f'? Wouldn't it make more sense to > either drop it, or make it convert the exponent to upper case (like 'E' and > 'G')? Compatibility with %-formatting is the only reason I can think

Re: [Python-Dev] PEP 3101: floats format 'f' and 'F'

2008-07-16 Thread Mark Dickinson
On Wed, Jul 16, 2008 at 4:15 PM, Eric Smith <[EMAIL PROTECTED]> wrote: > There's no exponent until the number gets large. I haven't looked up how > big the number has to get. On my Mac, it's somewhere between 1e50 and 1e60. I think it's around 1e50, courtesy of the rather oddly-phrased line in u

Re: [Python-Dev] PEP 3101: floats format 'f' and 'F'

2008-07-16 Thread Mark Dickinson
On Wed, Jul 16, 2008 at 4:14 PM, Daniel Stutzbach <[EMAIL PROTECTED]> wrote: > There's no exponent for small-magnitude numbers, but still an exponent > for large-magnitude numbers: > '%f' % (10**100) > '1e+100' So there is! Thanks for the correction. Mark ___

Re: [Python-Dev] PEP 3101: floats format 'f' and 'F'

2008-07-16 Thread Eric Smith
Mark Dickinson wrote: On Wed, Jul 16, 2008 at 3:35 PM, Eric Smith <[EMAIL PROTECTED]> wrote: Does anyone know why 'F' is the same as 'f'? Wouldn't it make more sense to either drop it, or make it convert the exponent to upper case What exponent? Isn't the point of 'f' formatting that there i

Re: [Python-Dev] PEP 3101: floats format 'f' and 'F'

2008-07-16 Thread Daniel Stutzbach
On Wed, Jul 16, 2008 at 10:07 AM, Mark Dickinson <[EMAIL PROTECTED]> wrote: > On Wed, Jul 16, 2008 at 3:35 PM, Eric Smith > <[EMAIL PROTECTED]> wrote: >> Does anyone know why 'F' is the same as 'f'? Wouldn't it make more sense to >> either drop it, or make it convert the exponent to upper case > >

Re: [Python-Dev] PEP 3101: floats format 'f' and 'F'

2008-07-16 Thread Mark Dickinson
On Wed, Jul 16, 2008 at 3:35 PM, Eric Smith <[EMAIL PROTECTED]> wrote: > Does anyone know why 'F' is the same as 'f'? Wouldn't it make more sense to > either drop it, or make it convert the exponent to upper case What exponent? Isn't the point of 'f' formatting that there is no exponent? In C,

[Python-Dev] PEP 3101: floats format 'f' and 'F'

2008-07-16 Thread Eric Smith
Does anyone know why 'F' is the same as 'f'? Wouldn't it make more sense to either drop it, or make it convert the exponent to upper case (like 'E' and 'G')? Compatibility with %-formatting is the only reason I can think of to keep up, but I get the sense we've given up on an automatic conver