diff options
| author | Olexander Yermakov <mannavard1611@gmail.com> | 2016-08-31 11:07:30 +0300 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-08-31 08:28:47 -0400 |
| commit | 7c57f5cf8cd10b69d0c76ba97ab048ccc2917c55 (patch) | |
| tree | 73e262f76e179f1a2a9859627f6a52d6a808a6a8 /django | |
| parent | c6c1d940c140b3f55d03902e9000801a7962e046 (diff) | |
[1.10.x] Fixed #27154 -- Allowed comparing CallableBool with bitwise or.
Thanks Tim for the review.
Backport of b7fb608142a0be568bc5dce952de5e6aefc2488c from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/utils/deprecation.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/django/utils/deprecation.py b/django/utils/deprecation.py index 0a0dd216da..dd1345757e 100644 --- a/django/utils/deprecation.py +++ b/django/utils/deprecation.py @@ -113,6 +113,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) |
