diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-09-08 20:22:46 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-09-08 20:22:46 (GMT) |
commit | 46ab5d09518286aabdd57f67bfd2ae7a6451afa2 (patch) | |
tree | 68f17ed70167e51344160fa20739e77cfb2ebfcc /Lib/decimal.py | |
parent | 3c064c172a0f075ad94bfaafe8823a05bc9b7cb8 (diff) | |
download | cpython-46ab5d09518286aabdd57f67bfd2ae7a6451afa2.zip cpython-46ab5d09518286aabdd57f67bfd2ae7a6451afa2.tar.gz cpython-46ab5d09518286aabdd57f67bfd2ae7a6451afa2.tar.bz2 |
Merged revisions 74723 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r74723 | mark.dickinson | 2009-09-08 21:20:19 +0100 (Tue, 08 Sep 2009) | 3 lines
Issue #6857: Fix Decimal formatting to be consistent with existing float
formatting: both are now right-aligned by default.
........
Diffstat (limited to 'Lib/decimal.py')
-rw-r--r-- | Lib/decimal.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py index e3fa8cb..33f5391 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -5577,7 +5577,10 @@ def _parse_format_specifier(format_spec, _localeconv=None): raise ValueError("Alignment conflicts with '0' in " "format specifier: " + format_spec) format_dict['fill'] = fill or ' ' - format_dict['align'] = align or '<' + # PEP 3101 originally specified that the default alignment should + # be left; it was later agreed that right-aligned makes more sense + # for numeric types. See http://bugs.python.org/issue6857. + format_dict['align'] = align or '>' # default sign handling: '-' for negative, '' for positive if format_dict['sign'] is None: |