21.04.18 13:42, Chris Angelico пише:
What you're seeing there is actually the peephole optimizer at work.
Since 3.7 constant folding is the AST optimizer work. The end result is the same in most cases though.
Other optimization takes place here too. Constants strings that look like identifiers (short string consisting of ASCII alphanumerical characters) are interned in the code object constructor.
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/