Path: csiph.com!usenet.pasdenom.info!news.franciliens.net!news.muarf.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'talks': 0.03; 'explicitly': 0.05; 'problem?': 0.07; 'string': 0.09; 'literal': 0.09; 'cc:addr:python-list': 0.11; 'behavior:': 0.16; 'definitions,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'incomplete': 0.16; 'subject:comment': 0.16; 'subject:quoted': 0.16; 'subject:simple': 0.16; 'subject:triple': 0.16; 'syntaxerror:': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'error': 0.23; 'sorry,': 0.24; 'cc:2**0': 0.24; 'header:In- Reply-To:1': 0.27; 'characters': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; '>>>>': 0.31; 'allows': 0.31; 'class': 0.32; 'url:python': 0.33; 'fri,': 0.33; 'raw': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'url:org': 0.36; 'expected': 0.38; 'pm,': 0.38; 'quote': 0.39; 'skip:u 10': 0.60; 'url:3': 0.61; 'kind': 0.63; 'url:4': 0.69; '2015': 0.84; 'url:reference': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=/wpBVg9b7FGDJjdNqwL/WrWFtBmKMI+cPGfCRRJgRrM=; b=Kx57Pfw7U5bMfhFkKTiJA9fyXaKNRwJ5tsT3f4wXUUoE8+Q10ZsZGO+dPuuQqocSD8 6XfOiTOFTGz9YFsb7QSl/cu+pDQMwF4KlknJE9TT8zHl907D5HQU5UvdeSYkoh5lq2nZ JMQu2cJZf98Xw7Wy3za/T8UxdugW0uyQCoi1f/C6ziHZxoILXpmeGJC+Xc7RUos9z0xQ PDQQfILbGiFMKT431fRkJIFv5/cQ/0Xhx+P3WIjGMdEL9nppRAR66tFVmxzcRaTqbv2x MPHtMwdo5bnXWvEwgKll7jvNqJIkeLQYrY8It3wCwJFpSP/TQi0CNC09Y6YVEn/XxJNc mn7A== MIME-Version: 1.0 X-Received: by 10.42.90.208 with SMTP id l16mr4128717icm.59.1428072010514; Fri, 03 Apr 2015 07:40:10 -0700 (PDT) In-Reply-To: <55a914a0-5901-4be5-9a35-74435ec060d1@googlegroups.com> References: <3533816.ZYnZ2OzjCs@PointedEars.de> <3971951.908YQu3oQO@PointedEars.de> <1504323.jUKfeKbQsP@PointedEars.de> <2362875.FIK8ImHTJA@PointedEars.de> <1823599.Pr2V0MPR6q@PointedEars.de> <9781856.5cutuNVPEq@PointedEars.de> <3894022.plrvF2nHWu@PointedEars.de> <1905422.ubGH1B8UfE@PointedEars.de> <551e27c5$0$12904$c3e8da3$5496439d@news.astraweb.com> <874mox3cs8.fsf@elektro.pacujo.net> <55a914a0-5901-4be5-9a35-74435ec060d1@googlegroups.com> Date: Sat, 4 Apr 2015 01:40:10 +1100 Subject: Re: r"\"" ??? (was A simple single line, triple-quoted comment) From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1428072017 news.xs4all.nl 2825 [2001:888:2000:d::a6]:44673 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:88483 On Fri, Apr 3, 2015 at 11:52 PM, Rustom Mody wrote: > Speaking about silliness of definitions, I was knocked out in class by this today: > >>>> r"\"" > '\\"' > > Seeing the docs > https://docs.python.org/3.4/reference/lexical_analysis.html#string-and-bytes-literals > it talks of this explicitly > > But I still find it strange -- I would have expected this kind of error behavior: > >>>> "A string" "another incomplete > SyntaxError: EOL while scanning string literal >>>> I'm sorry, I'm not understanding your confusion here. A raw string literal allows escaped quote characters - is that the problem? ChrisA