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
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
> ## 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
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
#