diff options
| author | bbangert <devnull@localhost> | 2006-06-01 03:10:42 +0000 |
|---|---|---|
| committer | bbangert <devnull@localhost> | 2006-06-01 03:10:42 +0000 |
| commit | 00ac4e80a50220f69578a81948d40575c3eeb2ea (patch) | |
| tree | 1fba030af5c66d9ce2832357e759cf65ba6d9222 /paste/util | |
| parent | e010000a17c40a4c288a1aef9f94077adc6a223e (diff) | |
| download | paste-00ac4e80a50220f69578a81948d40575c3eeb2ea.tar.gz | |
Fix for odd issue where sometimes the new mixin's len doesn't work, resulting in bool evaluations having infinite recursion. This nonzero override remedies the situation, why the endless recursion occurs with len is still a mystery.
Diffstat (limited to 'paste/util')
| -rw-r--r-- | paste/util/UserDict24.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/paste/util/UserDict24.py b/paste/util/UserDict24.py index 35f86fc..e5b64f5 100644 --- a/paste/util/UserDict24.py +++ b/paste/util/UserDict24.py @@ -162,3 +162,6 @@ class DictMixin: return cmp(dict(self.iteritems()), other) def __len__(self): return len(self.keys()) + + def __nonzero__(self): + return bool(self.iteritems()) |
