On 30/06/2020 04:08, Steven D'Aprano wrote:

We can write
inefficient code because dicts do *not* support index access:

     for i in range(len(d)):
         for j,item in enumerate(d.items()):
             if j == i:
                 do(item)

We certainly can.  The above is no different (apart from binding `i` and `j`) from

        for item in d.items():
                do(item)
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/34GPDFGOQ4EFTJUKDHJVUXVLKBHB6WWP/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to