At 01:03 PM 4/11/2007 -0400, Jason Orendorff wrote: >On 4/10/07, Raymond Hettinger <[EMAIL PROTECTED]> 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. _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
