summaryrefslogtreecommitdiff
path: root/Lib/UserString.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2002-04-15 13:36:47 +0000
committerWalter Dörwald <walter@livinglogic.de>2002-04-15 13:36:47 +0000
commit068325ef926538a30d7feb13f9b14a6163e24b6e (patch)
treec2eef78d030be1ce7a56b56420ba13a853aab57d /Lib/UserString.py
parentb384c7263928cc2d8dd16cac8537839673cd4982 (diff)
downloadcpython-git-068325ef926538a30d7feb13f9b14a6163e24b6e.tar.gz
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)
Diffstat (limited to 'Lib/UserString.py')
-rwxr-xr-xLib/UserString.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/UserString.py b/Lib/UserString.py
index f4f5cab96c..292e85242d 100755
--- a/Lib/UserString.py
+++ b/Lib/UserString.py
@@ -128,6 +128,7 @@ class UserString:
def translate(self, *args):
return self.__class__(self.data.translate(*args))
def upper(self): return self.__class__(self.data.upper())
+ def zfill(self, width): return self.__class__(self.data.zfill(width))
class MutableString(UserString):
"""mutable string objects