Skip to content

Commit fe4f769

Browse files
committed
Add __mod__ method to UserString.
1 parent b981df9 commit fe4f769

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Lib/UserString.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ def __radd__(self, other):
5555
def __mul__(self, n):
5656
return self.__class__(self.data*n)
5757
__rmul__ = __mul__
58+
def __mod__(self, args):
59+
return self.__class__(self.data % args)
5860

5961
# the following methods are defined in alphabetical order:
6062
def capitalize(self): return self.__class__(self.data.capitalize())

0 commit comments

Comments
 (0)