10.10.21 23:38, Guido van Rossum пише: > What's exasperating to me about this whole discussion is that nobody has > shown any reason why this kind of code would be occurring in user code. > STORE_FAST x LOAD_FAST x seems that it must come from a user writing > > x = x
No, it comes from pretty common code: for x in a: y = x**2 with open() as f: for x in f: ... x = get(): if x: ... But there is nothing to optimize here. This sequence is already fast. It can be replaced with "DUP_TOP; STORE_FAST x", but it would not be faster. Even if we introduce a new combined opcode, it would not be significantly faster, and it can slow down the eval loop. _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/EUYIABPM3QKP34ZG3YTHWDRYGQL2EY4P/ Code of Conduct: http://python.org/psf/codeofconduct/