1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Fixed #32208 -- Allowed adding lazy() objects.

Co-authored-by: Claude Paroz <claude@2xlibre.net>
This commit is contained in:
Hasan Ramezani
2020-12-19 20:53:30 +01:00
committed by Mariusz Felisiak
parent fe886eee36
commit 577f2338f1
3 changed files with 28 additions and 0 deletions

View File

@@ -176,6 +176,12 @@ def lazy(func, *resultclasses):
return str(self) % rhs
return self.__cast() % rhs
def __add__(self, other):
return self.__cast() + other
def __radd__(self, other):
return other + self.__cast()
def __deepcopy__(self, memo):
# Instances of this class are effectively immutable. It's just a
# collection of functions. So we don't need to do anything