[Python-Dev] Re: pre-PEP: Complete,
Structured Regular Expression Group Matching
Paul Moore
pf_moore at yahoo.co.uk
Sat Aug 7 16:12:53 CEST 2004
Mike Coleman <mkc at mathdogs.com> writes:
> Edward Loper <edloper at gradient.cis.upenn.edu> writes:
>> I wouldn't lose heart over the lack of response -- the current
>> flood of decorator messages tends to drown out everything else.
>
> No, not at all. I was hoping I might benefit from @-fatigue, though.
> :-)
I was interested in your message as a break from @decorators, but I
couldn't muster the energy to think about the proposal because I've
been reading too many @decorator messages. I guess you won one way and
lost the other :-)
Seriously, although I don't use the re module much (overreaction to an
early exposure to Perl, I guess) the idea seems useful. I'm not
entirely sure about the implementation, though - I dislike the name
structmatch, as it doesn't say what's going on very well. At first I
thought that having a separate method was overkill, but given that
re.search and re.match both exist, I take that back.
Maybe a better name would be re.parse? The function has a "feel" of
parsing a string according to a pattern.
The only other comment I have is that the semantics seem pretty
complex - I think that in practice, they do more or less what you want
them to, but the description is pretty obscure. And although I can see
that the error return has some value, I suspect that it might actually
complicate real use.
A suggestion - would it be possible to implement re.structmatch as a
pure Python prototype, to thrash out some of the usability questions?
If the function appears valuable in such a form, arguing for
incorporation into the re module would be a lot easier.
Hope this helps,
Paul.
--
The only reason some people get lost in thought is because it's
unfamiliar territory -- Paul Fix
More information about the Python-Dev
mailing list