Revision 2657
Added by Aaron Marcuse-Kubitza over 12 years ago
dicts.py | ||
---|---|---|
5 | 5 |
|
6 | 6 |
import util |
7 | 7 |
|
8 |
def is_dict(value): return hasattr(value, '__getitem__')
|
|
8 |
def is_dict(value): return hasattr(value, 'keys')
|
|
9 | 9 |
|
10 | 10 |
class DictProxy(UserDict.DictMixin): |
11 | 11 |
'''A proxy that forwards all accesses to an inner dict.''' |
Also available in: Unified diff
dicts.py: is_dict(): Fixed bug where lists also have getitem() methods, so keys() was checked for instead