In a function call with named arguments the code generated doesn't follow
that pattern:
dis.dis(lambda : f(a=1,b=2,c=3))
displays:
1 0 LOAD_GLOBAL 0 (foo)
3 LOAD_CONST 1 ('a')
6 LOAD_CONST 2 (1)
9
On 01/21/2015 11:16 PM, Neil Girdhar wrote:
Why not have BUILD_MAP work like BUILD_LIST? I.e., STORE_MAP takes a
parameter n and adds the last n pairs of stack elements into the n-1 stack
element (the dictionary).
It probably wouldn't make much difference. Building a list is
substantially
Building argument lists and dicts in python entails the following opcode
pattern:
1 0 BUILD_MAP3
3 LOAD_CONST 0 (2)
6 LOAD_CONST 1 (1)
9 STORE_MAP
10 LOAD_CONST 2 (4)