Faster 'if char in string' test

Kamilche klachemin at home.com
Thu Jun 24 21:34:42 EDT 2004


Peter Otten <__peter__ at web.de> wrote in message news:<cbeuh6$lq3$06$1 at news.t-online.com>...
 
> Note how badly your solution using str.translate() may perform for certain
> data due to its failure to shortcut.
> 
> Peter

Heheh, I'm a Python newbie. I can't even understand the code you have
written, but I'll try.

You know, as I was writing stuff like fn(**args.__dict__) yesterday
(which for me is pretty advanced!), it occurred to me that Python is
not 'simpler than C', like I had originally thought. :-D It's better
in many ways, but it has its dark alleyways where a novice can get
stabbed in the back, too.

{looks suspiciously down the dark alleyway where Peter's code is
standing, and tries to glide by undetected.}

--Kamilche



More information about the Python-list mailing list