mirror of
https://github.com/python/cpython.git
synced 2025-01-21 07:55:16 +08:00
Add __mod__ method to UserString.
This commit is contained in:
parent
b981df9943
commit
fe4f769fb8
@ -55,6 +55,8 @@ class UserString:
|
||||
def __mul__(self, n):
|
||||
return self.__class__(self.data*n)
|
||||
__rmul__ = __mul__
|
||||
def __mod__(self, args):
|
||||
return self.__class__(self.data % args)
|
||||
|
||||
# the following methods are defined in alphabetical order:
|
||||
def capitalize(self): return self.__class__(self.data.capitalize())
|
||||
|
Loading…
Reference in New Issue
Block a user