Removed redundant numbered parameters from str.format().

Since Python 2.7 and 3.1, "{0} {1}" is equivalent to "{} {}".
This commit is contained in:
Berker Peksag 2014-11-27 02:41:27 +02:00 committed by Tim Graham
parent 50c1d8f24b
commit 560b4207b1
24 changed files with 72 additions and 72 deletions

View file

@ -43,7 +43,7 @@ class TestUtilsHtml(TestCase):
def test_format_html(self):
self.assertEqual(
html.format_html("{0} {1} {third} {fourth}",
html.format_html("{} {} {third} {fourth}",
"< Dangerous >",
html.mark_safe("<b>safe</b>"),
third="< dangerous again",

View file

@ -28,13 +28,13 @@ class TestNumberFormat(TestCase):
self.assertEqual(nformat('-1234.33', '.', decimal_pos=1), '-1234.3')
def test_large_number(self):
most_max = ('{0}179769313486231570814527423731704356798070567525844996'
most_max = ('{}179769313486231570814527423731704356798070567525844996'
'598917476803157260780028538760589558632766878171540458953'
'514382464234321326889464182768467546703537516986049910576'
'551282076245490090389328944075868508455133942304583236903'
'222948165808559332123348274797826204144723168738177180919'
'29988125040402618412485836{1}')
most_max2 = ('{0}35953862697246314162905484746340871359614113505168999'
'29988125040402618412485836{}')
most_max2 = ('{}35953862697246314162905484746340871359614113505168999'
'31978349536063145215600570775211791172655337563430809179'
'07028764928468642653778928365536935093407075033972099821'
'15310256415249098018077865788815173701691026788460916647'

View file

@ -17,7 +17,7 @@ class SafeJoinTests(unittest.TestCase):
drive, path = os.path.splitdrive(safe_join("/", "path"))
self.assertEqual(
path,
"{0}path".format(os.path.sep),
"{}path".format(os.path.sep),
)
drive, path = os.path.splitdrive(safe_join("/", ""))