[issue42754] Unpacking of literals inside other literals should be optimised away by the compiler

Pablo Galindo Salgado report at bugs.python.org
Mon Dec 28 18:19:28 EST 2020


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

> This is a similar case. I am -1 for this optimization.

Yeah, I concur. One of the major drawbacks of this is that the normal case where this happens involves a Load():

z = "something"
x = ["a", *z, "b"]

I see almost no reason to nest the literals in this case, especially in a context sensitive scope. I am closing the draft PR and the issue.

Thanks Patrick for the proposal, though!

----------
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42754>
_______________________________________


More information about the Python-bugs-list mailing list