Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #50814

Re: Python-list Digest, Vol 118, Issue 144

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 <benlast@gmail.com>
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 <mailman.23559.1374105603.3113.python-list@python.org>
References <mailman.23559.1374105603.3113.python-list@python.org>
From Ben Last <ben@benlast.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4819.1374110968.3114.python-list@python.org> (permalink)
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

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

> From: Gregory Ewing <greg.ewing@canterbury.ac.nz>
> 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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Python-list Digest, Vol 118, Issue 144 Ben Last <ben@benlast.com> - 2013-07-18 09:29 +0800

csiph-web