Re: Py-dea: Streamline string literals now!

2011-12-29 Thread Chris Angelico
On Fri, Dec 30, 2011 at 10:19 AM, Lie Ryan wrote: > right and you can generalize this idea even further Don't stop generalizing. Everything should be custom. http://rosuav.com/1/?id=683 ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Py-dea: Streamline string literals now!

2011-12-29 Thread Lie Ryan
On 12/29/2011 12:44 PM, Dan Sommers wrote: On Wed, 28 Dec 2011 22:54:16 +, 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! "

Re: Py-dea: Streamline string literals now!

2011-12-28 Thread Dan Sommers
On Wed, 28 Dec 2011 22:54:16 +, 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

Re: Py-dea: Streamline string literals now!

2011-12-28 Thread Chris Angelico
On Thu, Dec 29, 2011 at 9:54 AM, Steven D'Aprano wrote: > Thank you Rick for yet another brilliant, well-thought-out idea. I look > forward to seeing your fork of Python with this change. How is it going? > I hope you aren't going to disappoint the legions of your fans who are > relying on you to

Re: Py-dea: Streamline string literals now!

2011-12-28 Thread Steven D'Aprano
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!

Re: Py-dea: Streamline string literals now!

2011-12-28 Thread Nathan Rice
On Wed, Dec 28, 2011 at 4:42 PM, Chris Angelico wrote: > On Thu, Dec 29, 2011 at 8:24 AM, Nathan Rice > wrote: >> Quotes are obnoxious in the nesting sense because everyone uses quotes >> for string delimiters.  By the same token, quotes are wonderful >> because not only are they intuitive to pro

Re: Py-dea: Streamline string literals now!

2011-12-28 Thread Chris Angelico
On Thu, Dec 29, 2011 at 8:24 AM, Nathan Rice wrote: > Quotes are obnoxious in the nesting sense because everyone uses quotes > for string delimiters.  By the same token, quotes are wonderful > because not only are they intuitive to programmers, but they are > intuitive in general.  Parenthesis are

Re: Py-dea: Streamline string literals now!

2011-12-28 Thread Nathan Rice
Quotes are obnoxious in the nesting sense because everyone uses quotes for string delimiters. By the same token, quotes are wonderful because not only are they intuitive to programmers, but they are intuitive in general. Parenthesis are pretty much in the same boat... I *HATE* them nested, but th

Re: Py-dea: Streamline string literals now!

2011-12-28 Thread python
Lie, > And of course, I can't believe you forget Guido's favourite version, g"", > available in musical and sirloin cloth flavor. LMAO! That was brilliant! :) Cheers! Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Py-dea: Streamline string literals now!

2011-12-28 Thread Lie Ryan
On 12/28/2011 04:34 PM, Rick Johnson wrote: On Dec 27, 9:49 pm, Rick Johnson wrote: The fact is...even with the multi-line issue solved, we still have two forms of literal delimiters that encompass two characters resulting in *four* possible legal combinations of the exact same string! I don't

Re: Py-dea: Streamline string literals now!

2011-12-28 Thread Ian Kelly
On Wed, Dec 28, 2011 at 12:36 PM, Rick Johnson wrote: > My point was... while Greg's idea is nice, it is not the answer. > HOWEVER, he did find the perfect char, and that char is the pipe! --> > | > > mlstr = ||| > this is a > multi line sting that is > delimited by "triple pipes". Or we > could j

Re: Py-dea: Streamline string literals now!

2011-12-28 Thread Lie Ryan
On 12/29/2011 06:36 AM, Rick Johnson wrote: mlstr = ||| this is a multi line sting that is delimited by "triple pipes". Or we could just 'single pipes' if we like, however, i think the "triple pipe' is easier to see. Since the pipe char is so rare in Python source, it becomes the obvious choice.

Re: Py-dea: Streamline string literals now!

2011-12-28 Thread Dominic Binks
On 12/28/2011 11:36 AM, Rick Johnson wrote: On Dec 28, 12:58 am, Steven D'Aprano wrote: On Tue, 27 Dec 2011 21:34:19 -0800, Rick Johnson wrote: I am also thinking that ANY quote char is a bad choice for string literal delimiters. Why? Well because it is often necessary to embed single or dou

Re: Py-dea: Streamline string literals now!

2011-12-28 Thread Rick Johnson
On Dec 28, 12:58 am, Steven D'Aprano wrote: > On Tue, 27 Dec 2011 21:34:19 -0800, Rick Johnson wrote: > > I am also thinking that ANY quote char is a bad choice for string > > literal delimiters. Why? Well because it is often necessary to embed > > single or double quotes into a string literal. W

Re: Py-dea: Streamline string literals now!

2011-12-27 Thread Chris Angelico
On Wed, Dec 28, 2011 at 4:34 PM, Rick Johnson wrote: > I am also thinking that ANY quote char is a bad choice for string > literal delimiters. Why? Well because it is often necessary to embed > single or double quotes into a string literal. Postgres allows dollar-delimited strings, which get arou

Re: Py-dea: Streamline string literals now!

2011-12-27 Thread Steven D'Aprano
On Tue, 27 Dec 2011 21:34:19 -0800, Rick Johnson wrote: > Now. If anyone can look at that mess and not admit it is a disaster, > well then... It isn't a disaster. A disaster is when people die, lose their houses, get tossed out into the street to starve, radioactive contamination everywhere, fl

Re: Py-dea: Streamline string literals now!

2011-12-27 Thread Rick Johnson
On Dec 27, 9:49 pm, Rick Johnson wrote: > The fact is...even with the multi-line issue solved, we still have two > forms of literal delimiters that encompass two characters resulting in > *four* possible legal combinations of the exact same string! I don't > know about you guys, but i am not a bi

Re: Py-dea: Streamline string literals now!

2011-12-27 Thread Rick Johnson
On Dec 27, 10:17 pm, Chris Angelico wrote: > On Wed, Dec 28, 2011 at 2:49 PM, Rick Johnson > > wrote: > > My proposal is to introduce a single delimiter for string literals. A > > new string literal that is just as good at spanning single lines as it > > is spanning multiple lines. A new literal

Re: Py-dea: Streamline string literals now!

2011-12-27 Thread Steven D'Aprano
On Tue, 27 Dec 2011 19:49:12 -0800, Rick Johnson wrote: > I believe that with the ubiquitous-ness of syntax highlight, string > literals only need one delimiter. In the old days (before syntax > highlight was invented) i could understand how a programmer "might" miss > a single (or even a triple!

Re: Py-dea: Streamline string literals now!

2011-12-27 Thread Chris Angelico
On Wed, Dec 28, 2011 at 2:49 PM, Rick Johnson wrote: > My proposal is to introduce a single delimiter for string literals. A > new string literal that is just as good at spanning single lines as it > is spanning multiple lines. A new literal that uses widely known > markup tag syntax instead of cr

Py-dea: Streamline string literals now!

2011-12-27 Thread Rick Johnson
Hello folks, In a recent thread i stumbled upon an epiphany of sorts concerning Python string literals, with implications that trickle down to all forms of string literals used in general programming, since, for the most part, the syntax is virtually the same! For all our lives we have been excep