Kaydet (Commit) 1b7aec35 authored tarafından Guido van Rossum's avatar Guido van Rossum

Fix PR#31 -- zfill() mishandles empty string.

üst 42636dc6
......@@ -475,7 +475,7 @@ def zfill(x, width):
n = len(s)
if n >= width: return s
sign = ''
if s[0] in ('-', '+'):
if s[:1] in ('-', '+'):
sign, s = s[0], s[1:]
return sign + '0'*(width-n) + s
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment