Re: Unpacking sequences and keywords in one function call

2006-11-13 Thread Noah Rawlins
ram wrote: > Stupid question #983098403: > > I can't seem to pass an unpacked sequence and keyword arguments to a > function at the same time. What am I doing wrong? > > def f(*args, **kw): > for a in args: > print 'arg:', a > for (k,v) in kw.iteritems(): > print k, '=', v

Re: re.match -- not greedy?

2006-11-19 Thread Noah Rawlins
Carl Banks wrote: > EXI-Andrews, Jack wrote: >> the '*' and '+' don't seem to be greedy.. they will consume less in >> order to match a string: >> > import re;re.match('(a+)(ab)','aaab').groups() >> ('aa', 'ab') >> >> this is the sort of behaviour i'd expect from >>'(a+?)(ab)' >> >> a+ shou

Re: Is time.time() < time.time() always true?

2006-11-21 Thread Noah Rawlins
Ben Finney wrote: > Really? Where does Python guarantee that the left side *must* be > evaluated before the right side of a comparison? (If the right side > were to be evaluated first, the left might end up with a greater > value.) > http://docs.python.org/ref/evalorder.html -- http://mail.pytho

Re: best way to align words?

2006-11-30 Thread Noah Rawlins
Robert R. wrote: > Hello, > > i would like to write a piece of code to help me to align some sequence > of words and suggest me the ordered common subwords of them > > s0 = "this is an example of a thing i would like to have".split() > s1 = "another example of something else i would like to have"

Re: best way to align words?

2006-11-30 Thread Noah Rawlins
Noah Rawlins wrote: > > >>> strList = [] > >>> strList.append('this is an example of a thing i would like to have') > >>> strList.append('another example of something else i would like to > have') > >>> strList.appen