What is Python?
Aahz Maruch
aahz at panix.com
Wed Sep 20 19:57:17 EDT 2000
In article <slrn8shsrn.ob.tim at degree.ath.cx>,
Tim Hammerquist <tim at degree.ath.cx> wrote:
>
>Regexps are optimized for matching text against patterns as
>quickly and efficiently as possible, whereas you can only have so many:
>
> if 'x' in word:
>
>statements before you're bloating your code unnecessarily.
True. OTOH, many Perl programmers are so focused on regexes that they
would try to implement the following code with regexes:
dict = { ... }
for word in words:
if dict.has_key(word):
...
--
--- Aahz (Copyright 2000 by aahz at pobox.com)
Androgynous poly kinky vanilla queer het <*> http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6
Member of the Groucho Marx Fan Club --Aahz
More information about the Python-list
mailing list