Issue6857
Created on 2009-09-07 15:46 by skrah, last changed 2009-09-08 20:31 by eric.smith.
|
msg92370 - (view) |
Author: Stefan Krah (skrah) |
Date: 2009-09-07 15:46 |
|
format(float("0.12345"), "7.0") -> ' 0.1'
The default alignment should be 'left-aligned'.
|
|
msg92378 - (view) |
Author: Mark Dickinson (mark.dickinson) |
Date: 2009-09-07 17:42 |
|
Hmm. PEP 3101 does indeed say that left-aligned is the default, but it's
a bit of a strange default for numeric types. I'd expect integers (at
least) to be right-aligned by default.
I'd be inclined to say that the current float formatting is correct, and
that it's the Decimal formatting that's wrong.
|
|
msg92379 - (view) |
Author: Eric Smith (eric.smith) |
Date: 2009-09-07 17:52 |
|
That is interesting. I'd agree that it's a bug in the PEP. Note that
%-formatting right aligns floats by default:
>>> '%7.0g' % 0.12345
' 0.1'
I'll raise the issue on python-dev.
Eric.
|
|
msg92431 - (view) |
Author: Mark Dickinson (mark.dickinson) |
Date: 2009-09-08 20:25 |
|
I've changed the default alignment for Decimal instances to right-aligned
(so that it agrees with floats and ints) in r74723 (trunk), r74725 (py3k),
as agreed in the python-dev thread starting at:
http://mail.python.org/pipermail/python-dev/2009-September/091640.html
|
|
msg92432 - (view) |
Author: Eric Smith (eric.smith) |
Date: 2009-09-08 20:31 |
|
Thanks for the decimal work, Mark. I notice that complex is also left
aligned, by default. I'll take a look at that.
|
|
| Date |
User |
Action |
Args |
| 2009-09-08 20:31:49 | eric.smith | set | messages:
+ msg92432 |
| 2009-09-08 20:25:55 | mark.dickinson | set | messages:
+ msg92431 |
| 2009-09-07 17:52:40 | eric.smith | set | assignee: eric.smith messages:
+ msg92379 |
| 2009-09-07 17:42:43 | mark.dickinson | set | nosy:
+ mark.dickinson messages:
+ msg92378
|
| 2009-09-07 15:49:48 | skrah | set | nosy:
+ eric.smith
|
| 2009-09-07 15:46:46 | skrah | create | |
|