Is it safe to shre a reg exp object among threads?

2006-06-29 Thread overly . crazy . steve
Let's say I construct a regular expression object r by: r = re.compile("some pattern") Is it safe to let multiple threads to use r concurrently (use r.search on different strings, etc.)? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: execfile then import back

2006-06-02 Thread overly . crazy . steve
Dennis Lee Bieber wrote: > And the problem you are seeing is that the initial "v" in the t.py > that you "run", is considered "__main__.v", NOT "t.v" Yes, the 2 different copies of v apparently imply that __main__ and t are 2 different modules. But I had expected __main__ to be an alias of t

Re: execfile then import back

2006-06-01 Thread overly . crazy . steve
> ## x.py and y.py (they are identical) ## > import testexec > print "1:", v, testexec.v > testexec.v = 7 Oops, testexec should be changed to t instead. That is: ## x.py and y.py (they are identical) ## import t print "1:", v, t.v t.v = 7 -- http://mail.python.or

execfile then import back

2006-06-01 Thread overly . crazy . steve
I am seeing something strange with execfile. I've simplified the code to: ## t.py ## print "here" v = None def f(): global v v = 6 if __name__ == "__main__": f() print "0:", v execfile("x.py") print "0:", v execfile("y.py") print "0:", v #