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


Groups > comp.lang.python > #50330

Re: Stack Overflow moderator “animuson”

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'example:': 0.03; 'languages,': 0.04; 'c++,': 0.07; 'correct.': 0.07; 'expressions': 0.07; 'javascript,': 0.07; 'perl,': 0.07; 'php,': 0.09; 'skip:/ 10': 0.09; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'notation': 0.16; 'world!': 0.16; 'wrote:': 0.18; 'obviously': 0.18; 'wed,': 0.18; "python's": 0.19; 'things.': 0.19; 'example': 0.22; 'parse': 0.24; 'skip:% 10': 0.24; 'tells': 0.24; "haven't": 0.24; "i've": 0.25; 'this:': 0.26; 'least': 0.26; 'header:In- Reply-To:1': 0.27; 'idea': 0.28; 'chris': 0.29; "doesn't": 0.30; 'compared': 0.30; 'message-id:@mail.gmail.com': 0.30; '(which': 0.31; 'are.': 0.31; 'lot.': 0.31; 'peterson': 0.31; 'post.': 0.31; 'stuff': 0.32; 'regular': 0.32; 'text': 0.33; 'noticed': 0.34; "can't": 0.35; 'problem.': 0.35; 'something': 0.35; 'etc': 0.35; 'received:google.com': 0.35; 'largely': 0.36; 'much.': 0.36; 'doing': 0.36; 'so,': 0.37; 'performance': 0.37; '(3)': 0.38; 'mapping': 0.38; 'to:addr:python-list': 0.38; 'fact': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'no.': 0.61; 'simply': 0.61; 'information': 0.63; 'more': 0.64; '(5)': 0.74; 'jul': 0.74; '.....': 0.78; 'partial': 0.84; 'significance': 0.84; 'numerous': 0.93; '2013': 0.98
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:to :content-type; bh=u64gb7hPe0xDuD++Sf20x8z10MvVC/DO2er7eqyLBe4=; b=tpjRI1ztzxHFsGScr1w03sWOUSsRPkqcICAQQZQ9z4M6AEo5PmO8hpOTevp0srn6d5 gz+5Ya+UEHq3xQoGoyl7Yb7o2tgYLST1XRx7IFx9buEaHphJVBtGOleOfZHM0Mm9FdHP xd8LEPkYaFpjpcxOe9zloZCL4Xj6VsCDm0++/B9uR76xDlfeZl8B7NtBU7M9gsMqqMOk lXp2avvnWNasAUBy/8u+Paag+mezzR4V8f6tzwQwMZOyt2RZusMquwF/0j+7hiZmCG3U 6/cAbf7oyc5/i9Sn8CM75l4Q+69xYJvN6Y5P781zAHUv5kBsiL07J8nEQ7weqFPPYEWj ha+g==
MIME-Version 1.0
X-Received by 10.220.182.193 with SMTP id cd1mr18695409vcb.32.1373449145255; Wed, 10 Jul 2013 02:39:05 -0700 (PDT)
In-Reply-To <krj7sj$obo$7@dont-email.me>
References <krj40o$dgc$1@dont-email.me> <mailman.4491.1373444782.3114.python-list@python.org> <krj6pv$obo$3@dont-email.me> <mailman.4495.1373446976.3114.python-list@python.org> <krj7sj$obo$7@dont-email.me>
Date Wed, 10 Jul 2013 19:39:05 +1000
Subject Re: Stack Overflow moderator “animuson”
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
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.4498.1373449148.3114.python-list@python.org> (permalink)
Lines 52
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1373449148 news.xs4all.nl 15881 [2001:888:2000:d::a6]:47252
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:50330

Show key headers only | View raw


On Wed, Jul 10, 2013 at 7:01 PM, Mats Peterson <matsp999@aim.com> wrote:
> Chris Angelico <rosuav@gmail.com> wrote:
>> I know what regular expressions are. I've used them in Perl, PHP,
>> JavaScript, Python, C++, Pike, and numerous text editors (which may
>> have been backed by one of the above languages, or may have been
>> something else). Doesn't change the fact that I have no idea what the
>> significance is of your post.
>>
>> ChrisA
>
> You do? And you haven't noticed the inferior performance of regular
> expressions in Python compared to Perl? Then you obviously haven't
> used them a lot.

That would be correct. Why have I not used them all that much? Because
Python has way better ways of doing many things. Regexps are
notoriously hard to debug, largely because a nonmatching regex can't
give much information about _where_ it failed to match, and when I
parse strings, it's more often with (s)scanf notation instead - stuff
like this (Pike example as Python doesn't, afaik, have scanf support):

> data="Hello, world! I am number 42.";
> sscanf(data,"Hello, %s! I am number %d.",foo,x);
(3) Result: 2
> foo;
(4) Result: "world"
> x;
(5) Result: 42

Or a more complicated example:

sscanf(Stdio.File("/proc/meminfo")->read(),"%{%s: %d%*s\n%}",array data);
mapping meminfo=(mapping)data;

That builds up a mapping (Pike terminology for what Python calls a
dict) with the important information out of /proc/meminfo, something
like this:

([
  "MemTotal": 2026144,
  "MemFree": 627652,
  "Buffers": 183572,
  "Cached": 380724,
  ..... etc etc
])

So, no. I haven't figured out that Perl's regular expressions
outperform Python's or Pike's or SciTE's, because I simply don't need
them all that much. With sscanf, I can at least get a partial match,
which tells me where to look for the problem.

ChrisA

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


Thread

Stack Overflow moderator “animuson” Mats Peterson <matsp999@aim.com> - 2013-07-10 07:55 +0000
  Re: Stack Overflow moderator “animuson” Chris Angelico <rosuav@gmail.com> - 2013-07-10 18:26 +1000
    Re: Stack Overflow moderator “animuson” Steven D'Aprano <steve@pearwood.info> - 2013-07-10 08:37 +0000
      Re: Stack Overflow moderator “animuson” Mats Peterson <matsp999@aim.com> - 2013-07-10 08:33 +0000
        Re: Stack Overflow moderator “animuson” Chris Angelico <rosuav@gmail.com> - 2013-07-10 18:50 +1000
          Re: Stack Overflow moderator “animuson” Mats Peterson <matsp999@aim.com> - 2013-07-10 08:46 +0000
            Re: Stack Overflow moderator “animuson” Ian Kelly <ian.g.kelly@gmail.com> - 2013-07-10 03:12 -0600
              Re: Stack Overflow moderator “animuson” Mats Peterson <matsp999@aim.com> - 2013-07-10 09:13 +0000
            Re: Stack Overflow moderator “animuson” Joshua Landau <joshua@landau.ws> - 2013-07-10 10:52 +0100
            Re: Stack Overflow moderator “animuson” Robert Kern <robert.kern@gmail.com> - 2013-07-10 12:08 +0100
            Re: Stack Overflow moderator “animuson” Joshua Landau <joshua@landau.ws> - 2013-07-10 12:15 +0100
            Re: Stack Overflow moderator “animuson” Skip Montanaro <skip@pobox.com> - 2013-07-10 06:52 -0500
            Re: Stack Overflow moder ator “animuson” Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-10 15:01 +0000
              Re: Stack Overflow moder ator “animuson” CM <cmpython@gmail.com> - 2013-07-11 00:36 -0700
          Re: Stack Overflow moderator “animuson” Mats Peterson <matsp999@aim.com> - 2013-07-10 08:50 +0000
            Re: Stack Overflow moderator “animuson” Chris Angelico <rosuav@gmail.com> - 2013-07-10 19:10 +1000
    Re: Stack Overflow moderator “animuson” Mats Peterson <matsp999@aim.com> - 2013-07-10 08:32 +0000
      Re: Stack Overflow moderator “animuson” Chris Angelico <rosuav@gmail.com> - 2013-07-10 18:46 +1000
        Re: Stack Overflow moderator “animuson” Mats Peterson <matsp999@aim.com> - 2013-07-10 08:43 +0000
          Re: Stack Overflow moderator “animuson” Michael Torrie <torriem@gmail.com> - 2013-07-10 22:20 -0600
      Re: Stack Overflow moderator “animuson” Ian Kelly <ian.g.kelly@gmail.com> - 2013-07-10 03:00 -0600
    Re: Stack Overflow moderator “animuson” Mats Peterson <matsp999@aim.com> - 2013-07-10 08:42 +0000
      Re: Stack Overflow moderator “animuson” Chris Angelico <rosuav@gmail.com> - 2013-07-10 19:02 +1000
        Re: Stack Overflow moderator “animuson” Mats Peterson <matsp999@aim.com> - 2013-07-10 09:01 +0000
          Re: Stack Overflow moderator “animuson” Chris Angelico <rosuav@gmail.com> - 2013-07-10 19:39 +1000
            Re: Stack Overflow moderator “animuson” Mats Peterson <matsp999@aim.com> - 2013-07-10 12:22 +0000
              Re: Stack Overflow moderator “animuson” Michael Torrie <torriem@gmail.com> - 2013-07-10 22:26 -0600
      Re: Stack Overflow moderator “animuson” Ian Kelly <ian.g.kelly@gmail.com> - 2013-07-10 03:06 -0600
        Re: Stack Overflow moderator “animuson” Mats Peterson <matsp999@aim.com> - 2013-07-10 09:03 +0000
          Re: Stack Overflow moderator “animuson” Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-07-10 13:14 +0200
            Re: Stack Overflow moderator “animuson” Mats Peterson <matsp999@aim.com> - 2013-07-10 12:01 +0000
              Re: Stack Overflow moderator “animuson” Joshua Landau <joshua@landau.ws> - 2013-07-10 13:13 +0100
          Re: Stack Overflow moderator “animuson” Joshua Landau <joshua@landau.ws> - 2013-07-10 12:19 +0100
          Re: StackOverflowmoderator “animuson” Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-10 16:03 +0000
  Re: Stack Overflow moderator “animuson” Steven D'Aprano <steve@pearwood.info> - 2013-07-10 09:00 +0000
    Re: Stack Overflow moderator “animuson” Steve Simmons <square.steve@gmail.com> - 2013-07-10 12:18 +0100
    Re: Stack Overflow moderator “animuson” Mats Peterson <matsp999@aim.com> - 2013-07-10 12:13 +0000
      Re: Stack Overflow moderator “animuson” Chris Angelico <rosuav@gmail.com> - 2013-07-10 22:22 +1000
      Re: Stack Overflow moderator “animuson” Skip Montanaro <skip@pobox.com> - 2013-07-10 07:35 -0500
      Re: Stack Overflow moderator “animuson” Paul Scott <pscott209@gmail.com> - 2013-07-10 14:27 +0200
      Re: Stack Overflow moderator “animuson” Joshua Landau <joshua@landau.ws> - 2013-07-10 13:39 +0100
      Re: Stack Overflow moderator “animuson” Skip Montanaro <skip@pobox.com> - 2013-07-10 08:12 -0500
      Re: Stack Overflow moderator “animuson” memilanuk <memilanuk@gmail.com> - 2013-07-10 07:34 -0700
      Re: Stack Overflow moderator “animuson” alex23 <wuwei23@gmail.com> - 2013-07-11 12:04 +1000
    Re: Stack Overflow moderator “animuson” Joshua Landau <joshua@landau.ws> - 2013-07-10 16:54 +0100
      Re: Stack Overflow moderator “animuson” Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-10 17:15 +0000
        Re: Stack Overflow moderator “animuson” Joshua Landau <joshua@landau.ws> - 2013-07-10 18:53 +0100
          Re: Stack Overflow moderator “animuson” Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-10 23:28 +0000
    Re: Stack Overflow moderator “animuson” Ethan Furman <ethan@stoneleaf.us> - 2013-07-10 09:18 -0700
    Re: Stack Overflow moderator “animuson” Joel Goldstick <joel.goldstick@gmail.com> - 2013-07-10 12:32 -0400
    Re: Stack Overflow moderator “animuson” Joshua Landau <joshua@landau.ws> - 2013-07-10 18:55 +0100
    Re: Stack Overflow moderator “animuson” Antoine Pitrou <solipsis@pitrou.net> - 2013-07-18 08:54 +0000
    Re: Stack Overflow moderator “animuson” wxjmfauth@gmail.com - 2013-07-19 11:54 -0700
      Re: Stack Overflow moderator “animuson” Chris Angelico <rosuav@gmail.com> - 2013-07-20 08:35 +1000
      Re: Stack Overflow moderator “animuson” Dave Angel <davea@davea.name> - 2013-07-19 19:14 -0400
      Re: Stack Overflow moderator “animuson” Joshua Landau <joshua@landau.ws> - 2013-07-20 11:27 +0100
  Re: Stack Overflow moderator “animuson” Joshua Landau <joshua@landau.ws> - 2013-07-10 12:12 +0100
    Re: Stack Overflow moderator “animuson” Mats Peterson <matsp999@aim.com> - 2013-07-10 12:06 +0000
      Re: Stack Overflow moderator “animuson” Benedict Verheyen <benedict.verheyen@gmail.com> - 2013-07-10 13:53 +0000
        Re: Stack Overflow moderator “animuson” alex23 <wuwei23@gmail.com> - 2013-07-11 12:08 +1000
      Re: Stack Overflow moderator “animuson” Ian Kelly <ian.g.kelly@gmail.com> - 2013-07-10 10:02 -0600
      Re: Stack Overflow bans Mats Peterson (was Re: Stack Overflow moderator “animuson”) Michael Torrie <torriem@gmail.com> - 2013-07-10 22:38 -0600
  Re: Stack Overflow moderator “animuson” Benedict Verheyen <benedict.verheyen@gmail.com> - 2013-07-10 11:56 +0000
  Re: Stack Overflow  bans Mats Peterson (was Re: ....) Terry Reedy <tjreedy@udel.edu> - 2013-07-10 14:52 -0400
  Re: Stack Overflow moderator “animuson” Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-07-11 11:36 +0200
  Re: Stack Overflow moderator “animuson” Jake Angulo <jake.angulo@gmail.com> - 2013-07-19 17:33 +1000
  Re: Stack Overflow moderator “animuson” Kevin Walzer <kw@codebykevin.com> - 2013-07-19 20:47 -0400

csiph-web