News for hackers. Stuff that matters.
Re:The fate of reduce() in Python 3000 (2005) by theamk on Wednesday January 02, 2019 @01:34PM (#18808674)
I'd desugar it like this:

    >>> lookup = {}
    >>> for (x, lookup[x]) in ('ab', 'cd', 'ef'):
    ...     pass
    ... 
    >>> lookup
    {'a': 'b', 'c': 'd', 'e': 'f'}
This makes is much more clear that there is just a double assignment, and that comprehension are pretty close to regular `for` statement.

(this was a great example btw -- I write python3 a lot, and I was staring at it for a long time before Icould figure it out)

There are no comments on this comment yet.