Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(even': 0.05; '(python': 0.05; 'escape': 0.07; 'string;': 0.07; 'subject:Question': 0.07; 'python': 0.09; 'backslash': 0.09; 'literal': 0.09; 'received:internal': 0.09; 'backslash,': 0.16; 'character).': 0.16; 'characters:': 0.16; 'message- id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:mail.srv.osa': 0.16; 'received:messagingengine.com': 0.16; 'received:nyi.mail.srv.osa': 0.16; 'received:osa': 0.16; 'received:srv.osa': 0.16; 'syntaxerror:': 0.16; 'string': 0.17; 'odd': 0.17; 'string,': 0.17; 'header:In-Reply-To:1': 0.25; 'raw': 0.27; '(since': 0.29; 'consisting': 0.29; 'escaped': 0.29; 'remains': 0.29; "i'm": 0.29; 'knows': 0.30; 'docs': 0.33; 'quotes': 0.33; 'anyone': 0.33; 'to:addr:python-list': 0.33; 'but': 0.36; 'two': 0.37; 'subject:: ': 0.38; 'received:10': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'notice': 0.39; 'header:Received:5': 0.40; 'end': 0.40; 'header:Message-Id:1': 0.62; 'ever': 0.63; 'subject:Best': 0.91 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=letterboxes.org; h=message-id:from:to:mime-version:content-transfer-encoding :content-type:in-reply-to:references:subject:date; s=mesmtp; bh= /0Aka4CvoQz6V+DfloYtw/cXsHw=; b=Zwh2gESfyrxEZUjGikDOHSbxjNAQ9ZAj rhEPN8JRc2ewKvQ0pGY2nwtcGSJd5A15J3BljLBXr8S2uUCRZjy4IzqL72v58ZWi 3YOVmGDix8AoRRzKGPt1SUbTfNuVmQ863mqU8Ydm4P21YhgZWQ2jMRA1xGBXl3mL OOISIhN/Q+A= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:mime-version :content-transfer-encoding:content-type:in-reply-to:references :subject:date; s=smtpout; bh=/0Aka4CvoQz6V+DfloYtw/cXsHw=; b=stO pYNby7mwOGsOUXCjyjCmY7garpERVy6PTSB/skhTW5xEhtHzQl43WI/ssDgfJPhZ BuzavJu68eY5SrpbP5FFow7cWjhdlIaVT59e0VgK6QBBHrzRTkjeQ0J3jpnfCvU2 MHCx5xH04A1Wok4UdyEBy9ih1McAv1qYN2KkhtzU= X-Sasl-Enc: S4n9Tc84UdQ3JwGFu39LOR6BYY6tyLFu71VUIRH+hk36 1360075805 From: Albert Hopkins To: python-list@python.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-1ec1891e In-Reply-To: <1931346778.15606854.1360074752203.JavaMail.root@sequans.com> References: <1931346778.15606854.1360074752203.JavaMail.root@sequans.com> Subject: Re: Best Practice Question Date: Tue, 05 Feb 2013 09:50:05 -0500 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1360075809 news.xs4all.nl 6963 [2001:888:2000:d::a6]:47913 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38197 [...] > By the way, did someone ever notice that r'\' fails ? I'm sure there's a > reason for that... (python 2.5) Anyone knows ? > > r'\' > SyntaxError: EOL while scanning single-quoted string > > "Even in a raw string, string quotes can be escaped with a backslash, but the backslash remains in the string; for example, r"\"" is a valid string literal consisting of two characters: a backslash and a double quote; r"\" is not a valid string literal (even a raw string cannot end in an odd number of backslashes). Specifically, a raw string cannot end in a single backslash (since the backslash would escape the following quote character). " -- python docs