for a simple code [code] vexList = [1, 2, 3] print('vexList', list(vexList))
vexList=map(lambda e: e+1, vexList) print('vexList', list(vexList)) vexList = list(vexList) print('vexList', list(vexList)) vexList=map(lambda e: e*2,vexList) print('vexList', list(vexList)) [/code] py27 says [quote] ('vexList', [1, 2, 3]) ('vexList', [2, 3, 4]) ('vexList', [2, 3, 4]) ('vexList', [4, 6, 8]) [/quote] but py34 says [quote] vexList [1, 2, 3] vexList [2, 3, 4] vexList [] vexList [] [/quote] if I change the above code in to one line [code] vexList = [1, 2, 3] print('vexList', list(vexList)) vexList=list(map(lambda e: e+1, vexList)) print('vexList', list(vexList)) vexList=map(lambda e: e*2,vexList) print('vexList', list(vexList)) [/code] then py27 and py34 get same verList [quote] ('vexList', [1, 2, 3]) ('vexList', [2, 3, 4]) ('vexList', [4, 6, 8]) [/quote] I found 'filter' function behaves likely I found type(map(lambda e: e, vexList)) is <type 'list'> in py2 type(map(lambda e: e, vexList)) is <class 'map'> in py3 so, what produces this difference between py2 and py3 in nature? is there more examples? where can I find the text abiut his difference? Thanks -- https://mail.python.org/mailman/listinfo/python-list