j
k
j a
j l
$ def unpack_set(): ...return {*()} $ dis.dis(unpack_set) 2 0 BUILD_SET 0 2 LOAD_CONST 1 (()) 4 SET_UPDATE 1 6 RETURN_VALUE
$ def unpack_set():
return {*()}
$ dis.dis(unpack_set) 2 0 BUILD_SET 0 2 LOAD_CONST 1 (()) 4 SET_UPDATE 1 6 RETURN_VALUE
Seems like the peephole optimizer could be trained to easily recognize that the LOAD_CONST/SET_UPDATE pair will be a no-op. Skip
Attachments:
Back to the thread
Back to the list