[Python-3000] Reminder: Py3k PEPs due by April (original) (raw)

Phillip J. Eby pje at telecommunity.com
Wed Apr 11 19:17:39 CEST 2007


At 01:03 PM 4/11/2007 -0400, Jason Orendorff wrote:

On 4/10/07, Raymond Hettinger <python at rcn.com> wrote: > * Eliminate implicit string concatenation: "abc" "def" > in favor of an explicit + operation. That simplifies > the grammar just a bit and the compiler already is > smart enough to do constant fold this operation at > compile time. [...]

My gut instinct was "whoa, don't change that". But: I think this behavior comes from C, where it's useful mainly because of the preprocessor. In Python it's not as useful. And C experience is not as universal as it once was. I bet this looks pretty confusing the first time you run into it. Sure, I use it, but if it went away, I would type the plus sign. Not a problem. And it would be one less thing for newcomers to learn, and explicit is better, right?

But there's another Python principle here, I think... complexity of computation should be represented by complexity of syntax. We don't generally like to use properties for expensive computation, or methods for simple field access, for example. Putting in a '+' sign makes the code feel like there's more computation going on, even if the computation gets optimized away.



More information about the Python-3000 mailing list