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


Groups > comp.lang.python > #50814 > unrolled thread

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

Started byBen Last <ben@benlast.com>
First post2013-07-18 09:29 +0800
Last post2013-07-18 09:29 +0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#50814 — Re: Python-list Digest, Vol 118, Issue 144

FromBen Last <ben@benlast.com>
Date2013-07-18 09:29 +0800
SubjectRe: Python-list Digest, Vol 118, Issue 144
Message-ID<mailman.4819.1374110968.3114.python-list@python.org>

[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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web