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

Paul Rudin paul.nospam at rudin.co.uk
Wed Nov 10 04:51:16 EST 2010


Lawrence D'Oliveiro <ldo at geek-central.gen.new_zealand> writes:

> In message <mailman.787.1289336127.2218.python-list at python.org>, Terry Reedy 
> wrote:
>
>> 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]}
>
> How come Python itself doesn’t display things that way?

try: pprint.pprint(dict1)



More information about the Python-list mailing list