(original) (raw)
On 04/26/2018 11:18 AM, Chris Angelico
wrote:
In the reference implementation, it's just DUP\_TOP followed by STORE\_FAST (well, technically by "whatever the assignment compiles to", as it could be affected by global/nonlocal, closures, etc). Is there much advantage to creating a new opcode?
Probably not much, but I thought we now lived in an age of wonders where common sequences of opcodes were getting mashed together into new more-complicated-but-redundant bytecodes (e.g. BUILD\_MAP\_UNPACK\_WITH\_CALL) just to save on dispatch overhead. You're right, it'd be a micro-optimization, and its value would be debatable.
/arry