News for hackers. Stuff that matters.
Re:Show HN: Python-to-Python compiler for some 3.6 features ... by Marat_Dukhan on Thursday April 27, 2017 @12:15PM (#14212638)
lambda a, b: a + b kind of works, but you can't call it with tuple argument (which you could in Python 2.7). This hurts when e.g. you have a list of pairs and try to map when via lambda, e.g.: map(lambda a, b: a+b, [(1, 2), (3, 4)]). Even worse, this won't fail right away in Python 3 (thanks, lazy evaluation in map), but will raise when you try to use the result of map
Re:Show HN: Python-to-Python compiler for some 3.6 features ... by ben-schaaf on Thursday April 27, 2017 @01:36PM (#14213298)
That doesn't work in the python 2.7 that I'm running, just like python 3 it complains that I don't have enough arguments.
Re:Show HN: Python-to-Python compiler for some 3.6 features ... by Marat_Dukhan on Thursday April 27, 2017 @01:48PM (#14213383)
Right, needs brackets: lambda (a, b)
Re:Show HN: Python-to-Python compiler for some 3.6 features ... by recursive on Thursday April 27, 2017 @02:38PM (#14213742)
As far as I can tell, you're complaining about one character. This works.

    >>> add = lambda a, b: a + b
    >>> t = (1, 2)
    >>> add(*t)
    3
Is that extra asterisk the problem? Again, if you want a materialized list, pass it to `list()`. Projection failures will raise then.