>>> l1 = [{'url': 'ws.geonames.org', 'type': 'findNearby', 
'parameters': [50.100000000000001, 10.02]}, {'url': 'ws.geonames.org', 
'type': 'findNearby', 'parameters': [50.100000000000001, 10.02]}, 
{'url': 'ws.geonames.org', 'type': 'countryInfo', 'parameters': 
[50.100000000000001, 10.02]}, {'url': 'ws.geonames.org', 'type': 
'countryInfo', 'parameters': [50.100000000000001, 10.02]}]

>>> [dict(n) for n in set(tuple(n.items()) for n in l1)]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: list objects are unhashable

How do I make this return two records instead of four?




Fancy a job? - http://www.tiscali.co.uk/jobs/
__________________________________________

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to