On 08.11.12 03:11, Ned Batchelder wrote: > Sorry, I should have been clearer: I was asking about weird not to say, > "This is weird and should be changed!", but to get clarification from > Serhiy about his statement, " It will be weird if a dict comprehension > and a plain loop will be inconsistent." I honestly didn't know which > behavior he considered inconsistent and therefore weird. I was referring to two of the most popular idioms to dynamically create a dict. d = {} for x in a: d[k(x)] = v(x) d = {k(x): v(x) for x in a} For now these methods are consistent. I agree that the use of the side effects here is not a sensible idea, but when such effects occur by accident, it will cause a surprise.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4