Re: Trace KeyboardInterrupt exception?

2006-06-14 Thread andrewdalke
Tony Nelson wrote: > I'm trying to find out what is eating some KeyboardInterrupt exceptions > in a fairly large program (yum). My KeyboardInterrupt handler is called > for some Ctl-C presses, but for others nothing seems to happen. > ... I'd like to use a debugger to trace > KeyboardInterrupt e

Re: __lt__ slowing the "in" operator even if not called

2006-06-15 Thread andrewdalke
Emanuele Aina wrote: > I have some code which does a lot of "in" on lists containing objects > with no __eq__ defined. > > It all goes fast until I add the __lt__() method: then I have a > slowdown comparable to the one I get using the overridden __eq__, while > the __lt__ method is never called. >

Re: Seeking regex optimizer

2006-06-19 Thread andrewdalke
Kay Schluehr wrote: > I have a list of strings ls = [s_1,s_2,...,s_n] and want to create a > regular expression sx from it, such that sx.match(s) yields a SRE_Match > object when s starts with an s_i for one i in [0,...,n]. Why do you want to use a regex for this? When you have constant strings t

Re: Seeking regex optimizer

2006-06-19 Thread andrewdalke
Replying to me Mirco Wahab wrote: > If you pull the strings into (?>( ... )) (atomic groups), > this would't happen. Given that Python's re engine doesn't support this feature it doesn't really help the original poster's problem. Even if some future Python did support it, the limit to 100 named g

europython room share

2006-06-19 Thread andrewdalke
Is anyone here going to Europython and would like a roommate to help split the cost? I'll be there for all three days of the conference plus a few extra days for sprints. I figure I can move elsewhere if need be for the sprints. It looks like the best choices are St. Genis (because it is about 2

Re: Seeking regex optimizer

2006-06-20 Thread andrewdalke
Kay Schluehr replied to my question: > > Why do you want to use a regex for this? > > Because it is part of a tokenizer that already uses regexps and I do > not intend to rewrite / replace it. Switching to pytst is not a big change - there will be little impact on the rest of your code. On the ot

Re: Seeking regex optimizer

2006-06-20 Thread andrewdalke
Mirco Wahab wrote: > Hi, are you the A.Dalke from the Schulten group (VMD) as > listed here: http://www.ks.uiuc.edu/Overview/People/former.cgi Yes. But I left there nearly a decade ago. > # naive regex '\d+9' > # find some number only if it ends by 9 > my $str="10099000