On Wed, 28 Dec 2011 22:54:16 +0000, Steven D'Aprano wrote: > On Wed, 28 Dec 2011 11:36:17 -0800, Rick Johnson wrote: > >> The point is people, we should be using string delimiters that are >> ANYTHING besides " and '. Stop being a sheep and use your brain! > > "ANYTHING", hey? > > I propose we use ئ and ร as the opening and closing string delimiters. > Problem solved!
Why stop at pre-determined, literal delimiters? That's way too easy on the parser, whether that parser is a computer or a person. __string_delimiter__ = Ω # magic syntax; no quotes needed x = ΩhelloΩ __string_delimiter__ = # # that first # isn't a comment marker x = # this isn't a comment; it's part of the string this is a multi-line string # __string_delimiter__ = '' # the delimiter is delimited by whitespace # now I can have comments, again, too x = ''"hello"'' # now x contains two double-quote characters I'm sure that the implementation is trivial, and it's so much easier to write strings that contain quotes (not to mention how easy it is to read those strings back later). -- Dan -- http://mail.python.org/mailman/listinfo/python-list