STINNER Victor added the comment: > and realized this could be rewritten by the interpreter as:
Yeah, it could but it's tricky to implement it. The current peephole is implemented in C. You may first try to implement it using my astoptimizer project which is implemented in Python. At least to check if it's possible or not :-) https://bitbucket.org/haypo/astoptimizer astoptimizer only optimizes str%args if it succeed at compile time, so if all arguments are constant and no error is raised. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17068> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com