summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorOlexander Yermakov <mannavard1611@gmail.com>2016-08-31 11:07:30 +0300
committerTim Graham <timograham@gmail.com>2016-08-31 08:27:37 -0400
commitb7fb608142a0be568bc5dce952de5e6aefc2488c (patch)
tree339eff7e819dcb8c1f59c2781d9cc8ee13b81912 /django/utils
parentb961b51eaf5b57fabcee89ca09a76fdebfd6500d (diff)
Fixed #27154 -- Allowed comparing CallableBool with bitwise or.
Thanks Tim for the review.
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/deprecation.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/utils/deprecation.py b/django/utils/deprecation.py
index 020f69b032..6fc27a8edd 100644
--- a/django/utils/deprecation.py
+++ b/django/utils/deprecation.py
@@ -116,6 +116,9 @@ class CallableBool:
def __ne__(self, other):
return self.value != other
+ def __or__(self, other):
+ return bool(self.value or other)
+
CallableFalse = CallableBool(False)
CallableTrue = CallableBool(True)