From 00ac4e80a50220f69578a81948d40575c3eeb2ea Mon Sep 17 00:00:00 2001 From: bbangert Date: Thu, 1 Jun 2006 03:10:42 +0000 Subject: 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. --- paste/util/UserDict24.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'paste/util') 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()) -- cgit v1.2.1