[Tutor] TypeError: list objects are unhashable

2009-03-15 Thread qsqgeekyog...@tiscali.co.uk
>>> l1 = [{'url': 'ws.geonames.org', 'type': 'findNearby', 'parameters': [50.101, 10.02]}, {'url': 'ws.geonames.org', 'type': 'findNearby', 'parameters': [50.101, 10.02]}, {'url': 'ws.geonames.org', 'type': 'countryInfo', 'parameters': [50.101, 10.02]}, {'url

[Tutor] TypeError: dict objects are unhashable

2009-03-14 Thread qsqgeekyog...@tiscali.co.uk
hi, i have a list which contains duplicate dictionaries. how do i extract the unique items out? l1 = [{'a': 'ddd'}, {'a': 'ddd'}, {'b': 'eee'}, {'c': 'ggg'}] set(l1) TypeError: dict objects are unhashable but, >>> {'a': 'ddd'} == {'a': 'ddd'} True >>> david Fancy a job? - http://www.tiscal