Skip to content

Commit 4aa9dc5

Browse files
committed
+ cleanup
1 parent dd31833 commit 4aa9dc5

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Lib/test/test_fractions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,6 +1491,8 @@ def test_format_f_presentation_type(self):
14911491
(F('-1234.5678'), '07,.0f', '-01,235'),
14921492
(F('-1234.5678'), '08,.0f', '-001,235'),
14931493
(F('-1234.5678'), '09,.0f', '-0,001,235'),
1494+
# Corner-case - zero-padding specified through fill and align
1495+
# instead of the zero-pad character.
14941496
(F('1234.5678'), '0=12,.2f', '0,001,234.57'),
14951497
# Corner case where it's not clear whether the '0' indicates zero
14961498
# padding or gives the minimum width, but there's still an obvious
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Handle a corner-case for :class:`~fractions.Fraction`'s formatting: when no
2-
explicit alignment is given, preceding the width field by a zero ('0')
3-
character enables sign-aware zero-padding. Now we treat this as an
4-
equivalent to a fill character of '0' with an alignment type of '=', just as
5-
in case of :class:`float`'s.
1+
Handle corner-case for :class:`~fractions.Fraction`'s formatting: treat
2+
zero-padding (preceding the width field by a zero (``'0'``) character) as an
3+
equivalent to a fill character of ``'0'`` with an alignment type of ``'='``,
4+
just as in case of :class:`float`'s.

0 commit comments

Comments
 (0)