Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!txtfeed1.tudelft.nl!tudelft.nl!txtfeed2.tudelft.nl!amsnews11.chello.com!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; "'this": 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'subject:string': 0.09; '"""this': 0.16; 'delimiters': 0.16; "guido's": 0.16; 'guys,': 0.16; 'string",': 0.16; 'wrote:': 0.18; 'string,': 0.18; 'dec': 0.22; 'header:In-Reply-To:1': 0.22; 'literal': 0.23; 'string': 0.24; '"this': 0.24; 'fact': 0.27; 'missed': 0.28; 'version,': 0.28; 'bit': 0.28; '27,': 0.29; 'pm,': 0.29; 'actual': 0.32; "can't": 0.32; 'header:User-Agent:1': 0.33; 'actually': 0.33; 'header:X-Complaints-To:1': 0.33; 'to:addr :python-list': 0.34; 'mix': 0.34; 'issue': 0.35; 'received:au': 0.36; 'two': 0.37; 'but': 0.37; 'received:org': 0.38; 'characters': 0.39; 'johnson': 0.39; "it's": 0.40; 'raw': 0.40; 'to:addr:python.org': 0.40; 'double': 0.61; 'course,': 0.62; 'believe': 0.65; 'fan': 0.66; 'subject:!': 0.67; 'exact': 0.68; 'legal': 0.70; '04:34': 0.84; 'musical': 0.93; 'received:110': 0.95 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Lie Ryan Subject: Re: Py-dea: Streamline string literals now! Date: Thu, 29 Dec 2011 07:53:39 +1100 References: <280841b8-8674-4c1d-9a82-28982340a4b8@v24g2000yqk.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 110-175-240-90.static.tpgi.com.au User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1325105643 news.xs4all.nl 6848 [2001:888:2000:d::a6]:57434 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18142 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 >> know about you guys, but i am not a big fan of Tim Towtdi. > > actually i was a bit hasty with that statment and underestimated the > actual number of possiblities. > > 1) "this is a string" > 2) 'this is a string' > 3) r"this is a string" > 4) r'this is a string' > 5) '''this is a string''' > 6) """this is a string""" > 7) r'''this is a string''' > 8) r"""this is a string""" you missed u"nicode" string and b"yte" string, each of them available in both single and double quote flavor and single and triple quote flavor. Also, it's possible to mix them together ur"unicode raw string" or br"byte raw string", they are also in single and double quote flavor and single and triple quote flavor. And of course, I can't believe you forget Guido's favourite version, g"", available in musical and sirloin cloth flavor.