Message324263
> It would need a special case so that `for x in *a, *b:` doesn't first construct a tuple of all elements in a and b. Thoughts?
It may be surprising that `for x in *a, *b:` behave differently from `for x in (*a, *b):`.
It is idiomatic to create a list of keys and iterate it if you want to modify the dict during iterating:
for key in list(d):
# modify d
This can be written in a form
for key in [*d]:
# modify d
or
for key in (*d,):
# modify d
(although the latter variant is slightly slower). |
|
Date |
User |
Action |
Args |
2018-08-28 16:42:08 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, gvanrossum, mark.dickinson, benjamin.peterson |
2018-08-28 16:42:08 | serhiy.storchaka | set | messageid: <1535474528.37.0.56676864532.issue34508@psf.upfronthosting.co.za> |
2018-08-28 16:42:08 | serhiy.storchaka | link | issue34508 messages |
2018-08-28 16:42:08 | serhiy.storchaka | create | |
|