Apply the second version of SF patch http://www.python.org/sf/536241

Add a method zfill to str, unicode and UserString and change
Lib/string.py accordingly.

This activates the zfill version in unicodeobject.c that was
commented out and implements the same in stringobject.c. It also
adds the test for unicode support in Lib/string.py back in and
uses repr() instead() of str() (as it was before Lib/string.py 1.62)
This commit is contained in:
Walter Dörwald 2002-04-15 13:36:47 +00:00
parent b384c72639
commit 068325ef92
8 changed files with 83 additions and 13 deletions

View file

@ -227,6 +227,16 @@ def run_method_tests(test):
test('endswith', 'ab', 0, 'ab', 0, 1)
test('endswith', 'ab', 0, 'ab', 0, 0)
test('zfill', '123', '123', 2)
test('zfill', '123', '123', 3)
test('zfill', '123', '0123', 4)
test('zfill', '+123', '+123', 3)
test('zfill', '+123', '+123', 4)
test('zfill', '+123', '+0123', 5)
test('zfill', '-123', '-123', 3)
test('zfill', '-123', '-123', 4)
test('zfill', '-123', '-0123', 5)
test('zfill', '', '000', 3)
test('zfill', '34', '34', 1)
test('zfill', '34', '0034', 4)