News for hackers. Stuff that matters.
Re:Golang landmines by teraflop on Saturday September 17, 2016 @10:15PM (#12523596)
Python's behavior is the same as Go's. For example, this code:

    l = []
    for i in xrange(3):
      l.append(lambda: i)
    print [f() for f in l]
prints [2, 2, 2].
Re:Golang landmines by loevborg on Sunday September 18, 2016 @05:48AM (#12524632)
Same in javascript:

    var fns=[];
    for (var i=0; i<3; i++) {
       fns.push(function(){return i});
    };
    fns.map(function(x) { return x.call(); });
Returns

    [ 3, 3, 3 ]