On 9/5/2015 1:14 PM, Gustavo Carneiro wrote: > Why not allow string concatenation without plus sign only if/when the > implementation becomes optimised to allow compile time concatenation? > This makes it crystal clear whether the concatenation is compile time or > runtime. If we allow it now, it's hard to tell without looking at the > CPython source code...
Although you can make it faster than '+', it's not possible for it to be a compile-time concatenation. The PEP calls out that it's an expression that's evaluated at runtime. I think having strings concatenated with adjacent f-strings follows the principle of least surprise. I also think it won't get used all that often, just as compile-time string concatenation isn't seen with great frequency. Eric. _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com