Project

General

Profile

« Previous | Next » 

Revision 2657

dicts.py: is_dict(): Fixed bug where lists also have getitem() methods, so keys() was checked for instead

View differences:

lib/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