0

I was using python v2.7 with the following code:

    maxValues = {}
    for d in self.gdbs_data:
        for k1,v1 in d.items():
            for k2, v2 in v1.items():
                for k3, v3 in v2.items():
                    maxValues[(k2,str(k3))] = maxValues[(k2,str(k3))] \
                                    if (k2,str(k3)) in [i for i in maxValues.keys()] else ''

                    maxValues[(k2,str(k3))] = max(maxValues[(k2,str(k3))], d[k1][k2][k3])

    for d in self.gdbs_data:
        for k1,v1 in d.items():
            for k2, v2 in v1.items():
                inner = {k: v == maxValues[(k2,str(k))] for k, v in d[k1][k2].items()}

                d[k1][k2] = inner

But now i need the python v2.5 because i need use this old module that doesn't work with v2.7+. How could i change the code to be valid and work the same again?

Error:

Traceback (most recent call last):
  File "arp\__main__.py", line 8, in <module>
    from arp import ARP
  File "C:\Users\G1745 IRON\Development\LL\ARP\arp\arp.py", line 124
    inner = {k: v == maxValues[(k2,str(k))] for k, v in d[k1][k2].items()}
                                              ^
SyntaxError: invalid syntax

Thanks!

0 Answers0