Implicit String Concatenation Threads
Hey all, I've been forwarding (and trying to CC) our list on those messages as much as possible. In case any of you weren't already subscribed to the python-ideas list, Guido has proposed that python no longer allow the following: foo = ('abc' 'def' ) Mainly because it can cause confusing TypeErrors for the functions taking a certain number of arguments. There are a few ideas floating around that thread, one of which is that we (the code-quality tool authors) provide warnings or errors when someone does: foo('a' 'b') i.e., uses the implicit concatenation on a single line. I'm personally far more in favor of this (mainly for older versions of python) + a SyntaxError for newer versions but to allow the multi-line concatenation to continue. Some are in favor of adding a new string prefix like `m` or `s`. All of this aside, we may have to start including support for this in our tools so I wanted everyone to be well aware of the discussion. Hopefully people will continue the trend I've tried to start of CC'ing code-quality but that likely won't happen. Cheers, Ian
On 12 May 2013 04:24, Ian Cordasco <graffatcolmingov@gmail.com> wrote:
Mainly because it can cause confusing TypeErrors for the functions taking a certain number of arguments. There are a few ideas floating around that thread, one of which is that we (the code-quality tool authors) provide warnings or errors when someone does:
foo('a' 'b')
i.e., uses the implicit concatenation on a single line.
+1 -- Martin
On Sun, May 12, 2013 at 8:48 PM, Martin Pool <mbp@google.com> wrote:
On 12 May 2013 04:24, Ian Cordasco <graffatcolmingov@gmail.com> wrote:
Mainly because it can cause confusing TypeErrors for the functions taking a certain number of arguments. There are a few ideas floating around that thread, one of which is that we (the code-quality tool authors) provide warnings or errors when someone does:
foo('a' 'b')
i.e., uses the implicit concatenation on a single line.
+1
You might want to add that to the main discussion over on python-ideas too. I think it is really the best solution, and we can all implement it pretty easily at the moment.
participants (2)
-
Ian Cordasco
-
Martin Pool