diff options
Diffstat (limited to 'Lib/collections')
-rw-r--r-- | Lib/collections/__init__.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py index 960d82a..cb7f1bb 100644 --- a/Lib/collections/__init__.py +++ b/Lib/collections/__init__.py @@ -1214,9 +1214,8 @@ class UserString(_collections_abc.Sequence): __rmul__ = __mul__ def __mod__(self, args): return self.__class__(self.data % args) - def __rmod__(self, format): - return self.__class__(format % args) - + def __rmod__(self, template): + return self.__class__(str(template) % self) # the following methods are defined in alphabetical order: def capitalize(self): return self.__class__(self.data.capitalize()) def casefold(self): |