[Tutor] why inline-only string literals?
denis.spir at free.fr
Mon Feb 8 09:29:30 CET 2010
[sorry, Steve, first replied to sender instead of list]
On Sun, 7 Feb 2010 09:54:12 -0800
Steve Willoughby <steve at alchemy.com> wrote:
> I believe it's a deliberate design decision, [...]
> So by making you explicitly state when you wanted multi-line strings,
> it makes it easier to spot this common mistake as well as making
> your intent more clear when just looking at the code.
Thank you. I guess this really makes sense. Or rather it did make sense at the time of python design. Nowadays most editors (even not programming editors) are able to _very_ clearly show such errors (when I add a quote, the whole rest of the code becomes a string ;-).
It seems such a change would be backwards-compatible, no?
I thought there may be a (for me) hidden issue due to lexer+parser separation. My parser was PEG-based, so with a single grammar and a single pass. I'm not used to reason about lexers and token strings. But since python does have multi-line strings, anyway...
la vita e estrany
More information about the Tutor