Hi
is there a way to make an assignment in the condition of "if" and use
it later, e.g.
nx = re.compile('reg ex')
if nx.search(text) :
funCall(text, nx.search(text) )
nx.search(text) is evaluated twice, I was hoping for something like
nx = re.compile('reg ex')
if x = nx.search(text) :
funCall(text, x))
thanks
is there a way to make an assignment in the condition of "if" and use
it later, e.g.
nx = re.compile('reg ex')
if nx.search(text) :
funCall(text, nx.search(text) )
nx.search(text) is evaluated twice, I was hoping for something like
nx = re.compile('reg ex')
if x = nx.search(text) :
funCall(text, x))
thanks
Comment