Learning Pyhton - Functional Programming - How intersect/difference two dict with dict/values? fast!

Terry Reedy tjreedy at udel.edu
Tue Nov 9 15:55:16 EST 2010


> On 11/9/2010 9:32 AM, macm wrote:

>> dict1 = {'ab':[[1,2,3,'d3','d4',5],12],'ac':[[1,3,'78a','79b'],
>> 54],'ad': [[56,57,58,59],34], 'ax': [[56,57,58,59],34]}

To echo John Nagle's point, if you want non-masochist volunteers to read 
your code, write something readable like:

dict1 = {'ab': [[1,2,3,'d3','d4',5], 12],
          'ac': [[1,3,'78a','79b'], 54],
          'ad': [[56,57,58,59], 34],
          'ax': [[56,57,58,59], 34]}

-- 
Terry Jan Reedy




More information about the Python-list mailing list