Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!news2.euro.net!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.076 X-Spam-Evidence: '*H*': 0.85; '*S*': 0.00; 'subject:Python': 0.06; 'method,': 0.09; 'tests,': 0.09; 'cheers': 0.12; 'be:': 0.16; 'nope,': 0.16; 'sender:addr:gmail.com': 0.17; 'subject:Issue': 0.19; 'looks': 0.24; 'push': 0.26; 'header:In-Reply-To:1': 0.27; '8bit%:3': 0.30; 'subject:list': 0.30; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; "skip:' 10": 0.31; 'convenience': 0.31; 'them?': 0.31; 'front': 0.32; 'up.': 0.33; 'received:google.com': 0.35; 'there': 0.35; 'coverage': 0.36; 'thanks': 0.36; 'should': 0.36; 'unit': 0.37; 'email addr:python.org': 0.37; '8bit%:4': 0.38; 'to:addr:python-list': 0.38; 'skip:. 10': 0.39; 'to:addr:python.org': 0.39; 'different': 0.65; 'email name:python-list': 0.65; 'between': 0.67; "'then'": 0.84; 'skip:. 50': 0.84; 'skip:. 60': 0.84; 'received:mail- wi0-x229.google.com': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=UQQiNGw4mMm5FYieXu5DlEEDmP5CewWwldGjZdt4KpY=; b=rbZz5VnEWPLOwrWWmLju3jB7MLghbVaNMcFmi7MR8uAf11Xklnbz5U0j9jJpgoQ2r/ fGNVruslKy0IPIabBZIfFn5GjuCItOiCSrcIOxhlZuMVMZeR2EaqnThJLGtNCDs02u/o MZT0Y/4ZUX44m27jIVokIxqgSirh3a47Wr5vw/2VYsrtJ29zHyhw9Jr5+ddWpWOqRyz9 xF9eSldbDfWz9uwoXN7lqTpQZxB2LbYDY9rI6/D5ePmTqbPtVQLWU1G45a7hyTdJTpqc EL5EDcHjsy2/P4Zu9uR9VzdQlwpBnbjIN1pTb7wKVqKYFMpm80ngUzxigYt6VkNdkh34 i4/g== X-Received: by 10.180.185.148 with SMTP id fc20mr6582197wic.0.1374110966706; Wed, 17 Jul 2013 18:29:26 -0700 (PDT) MIME-Version: 1.0 Sender: benlast@gmail.com In-Reply-To: References: From: Ben Last Date: Thu, 18 Jul 2013 09:29:06 +0800 X-Google-Sender-Auth: WZ9MKWgZvKco1Vfw2fJgH-kTGD0 Subject: Re: Python-list Digest, Vol 118, Issue 144 To: python-list@python.org Content-Type: multipart/alternative; boundary=001a11c23f360d767304e1bf2413 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: 85 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1374110968 news.xs4all.nl 15923 [2001:888:2000:d::a6]:60377 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50814 --001a11c23f360d767304e1bf2413 Content-Type: text/plain; charset=UTF-8 > From: Gregory Ewing > To: python-list@python.org > Is 'dash' the same as 'literal("-")'? > Yes, it's a convenience method, like 'dot' and 'underscore'. The code I pasted is from the unit tests, where I use the different methods to push coverage up. > Is there any difference between 'then' and 'followed_by'? > Nope, they're synonyms. Same as 'zero_or_more' is the same as 'any_number_of', or 'digit' is the same as 'digits'. Why do some things have __ in front of them? Is there a > difference between 'literal' and '__literal'? > Er... looks like a garblement in my post! There are no __ in my original :( It should be: north_american_number_re = (RE().start .literal('(').followed_by.exactly(3).digits.then.literal(')') .then.one.literal("-").then.exactly(3).digits .then.one.dash.followed_by.exactly(4).digits.then.end .as_string()) Thanks for the comments! Cheers b --001a11c23f360d767304e1bf2413 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

=
From:=C2=A0Gregory Ewing <greg.ewing@canterbury.ac.nz>
To:=C2=A0python-list@python.org
Is 'dash' the same as= 'literal("-")'?
Yes, it's a convenience method, like 'dot' an= d 'underscore'. =C2=A0The code I pasted is from the unit tests, whe= re I use the different methods to push coverage up.
=C2=A0
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;pa= dding-left:1ex"> Is there any difference between 'then' and 'followed_by'?
Nope, they're synonyms. =C2=A0Same as 'zero_or_= more' is the same as 'any_number_of', or 'digit' is the= same as 'digits'.

Why do some things have __ in front of them? Is there a
difference between 'literal' and '__literal'?
Er... looks like a garblement in my post! =C2=A0There are no __ in = my original :( =C2=A0It should be:

north_american_number_re =3D (RE().start=
=C2=A0 .literal('(').fol= lowed_by.exactly(3).digits.then.literal(')')
=C2=A0 .then.one.literal("-").th= en.exactly(3).digits
=C2=A0 .then.one.dash.followed_b= y.exactly(4).digits.then.end
=C2=A0 .as_string())

Thanks = for the comments!
Cheers
b


--001a11c23f360d767304e1bf2413--