Re: map vs. list-comprehension

2005-07-02 Thread Tom Anderson
On Fri, 1 Jul 2005, Sion Arrowsmith wrote: > Tom Anderson <[EMAIL PROTECTED]> wrote: >> On Thu, 30 Jun 2005, Roy Smith wrote: >> >>> Even some of the relatively recent library enhancements have been kind >>> of complicated. The logging module, for example, seems way over the >>> top. >> >> Exa

Re: map vs. list-comprehension

2005-07-01 Thread Roy Smith
Scott David Daniels <[EMAIL PROTECTED]> wrote: >Roy Smith wrote: >> Look at what happened to C when it mutated into C++. In isolation, most of >> the features of C++ seem like good ideas. Taken together, it's a huge >> hairy mess that most people only understand increasingly larger subsets of.

Re: map vs. list-comprehension

2005-07-01 Thread Scott David Daniels
Roy Smith wrote: > Look at what happened to C when it mutated into C++. In isolation, most of > the features of C++ seem like good ideas. Taken together, it's a huge > hairy mess that most people only understand increasingly larger subsets of. > Fred Brooks called it the second system syndrom

Re: map vs. list-comprehension

2005-07-01 Thread Stelios Xanthakis
Mandus wrote: > jepp - faster, but still slower than the map. > > 100 iterations: > zip+list-comprehension: 8.1s > izip+list-comprehension: 7.5s > map: 7.0s > Strange. On 2.4.1 izip is the fastest. The thing is that if you put benchmark code in global the results are not fair as each var

Re: map vs. list-comprehension

2005-07-01 Thread Sion Arrowsmith
Tom Anderson <[EMAIL PROTECTED]> wrote: >On Thu, 30 Jun 2005, Roy Smith wrote: >> Even some of the relatively recent library enhancements have been kind >> of complicated. The logging module, for example, seems way over the >> top. >Exactly the same thing happened with Java. I was under the im

Re: map vs. list-comprehension

2005-07-01 Thread George Sakkis
"Tom Anderson" wrote: > On Fri, 1 Jul 2005, George Sakkis wrote: > > > Keeping the language small is a worthwhile goal, but it should be traded > > off with conciseness and readability; otherwise we could well be content > > with s-expressions. > > There's quite a number of satisfied LISP programm

Re: map vs. list-comprehension

2005-07-01 Thread Tom Anderson
On Fri, 1 Jul 2005, George Sakkis wrote: > "Terry Hancock" wrote: > > Keeping the language small is a worthwhile goal, but it should be traded > off with conciseness and readability; otherwise we could well be content > with s-expressions. There's quite a number of satisfied LISP programmers ou

Re: map vs. list-comprehension

2005-07-01 Thread Tom Anderson
On Thu, 30 Jun 2005, Roy Smith wrote: > Terry Hancock <[EMAIL PROTECTED]> wrote: > >> One of the strengths of Python has been that the language itself is >> small (which it shares with C and (if I understand correctly, not being >> a lisp programmer?) Lisp), but with all the syntax enhancements

Re: map vs. list-comprehension

2005-07-01 Thread George Sakkis
"Terry Hancock" wrote: > On Thursday 30 June 2005 09:49 am, Mike P. wrote: > > > IMHO I'm not particularly happy with the way Python is going language wise. > > I mean, I don't think I'll ever use decorators, for example. Personally, in > > terms of language features and capabilities I think the l

Re: map vs. list-comprehension

2005-06-30 Thread Roy Smith
Robert Kern <[EMAIL PROTECTED]> wrote: > Looks like the PSU got to yoNO CARRIER No, the trackpad on my PowerBook seems to have gone a little haywire and I'm getting the occasional random mouse click. In that case, it seemed to have clicked the "Post" button. -- http://mail.python.org/mailman/

Re: map vs. list-comprehension

2005-06-30 Thread Roy Smith
Terry Hancock <[EMAIL PROTECTED]> wrote: > One of the strengths of Python has been that the language itself is > small (which it shares with C and (if I understand correctly, not being > a lisp programmer?) Lisp), but with all the syntax enhancements going > on, Python is getting pretty complica

Re: map vs. list-comprehension

2005-06-30 Thread Robert Kern
Roy Smith wrote: > Terry Hancock <[EMAIL PROTECTED]> wrote: > >>One of the strengths of Python has been that the language itself is >>small (which it shares with C and (if I understand correctly, not being >>a lisp programmer?) Lisp), but with all the syntax enhancements going >>on, Python is g

Re: map vs. list-comprehension

2005-06-30 Thread Roy Smith
Terry Hancock <[EMAIL PROTECTED]> wrote: > One of the strengths of Python has been that the language itself is > small (which it shares with C and (if I understand correctly, not being > a lisp programmer?) Lisp), but with all the syntax enhancements going > on, Python is getting pretty complica

Re: map vs. list-comprehension

2005-06-30 Thread Terry Hancock
On Thursday 30 June 2005 09:49 am, Mike P. wrote: > That really sucks, I wasn't aware of these plans. Ok, I don't use reduce > much, but I use lambda, map and filter all the time. > [...] > Also, I don't necessarily think list comprehensions are necessarily easier > to read. I don't use them all t

Re: map vs. list-comprehension

2005-06-30 Thread Tom Anderson
On Fri, 1 Jul 2005, Mike P. wrote: "Björn Lindström" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] "F. Petitjean" <[EMAIL PROTECTED]> writes: res = [ bb+ii*dd for bb,ii,dd in zip(b,i,d) ] Hoping that zip will not be deprecated. Nobody has suggested that. The ones that are pla

Re: map vs. list-comprehension

2005-06-30 Thread Mike P.
"Björn Lindström" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "F. Petitjean" <[EMAIL PROTECTED]> writes: > > > res = [ bb+ii*dd for bb,ii,dd in zip(b,i,d) ] > > > > Hoping that zip will not be deprecated. > > Nobody has suggested that. The ones that are planned to be removed are

Re: map vs. list-comprehension

2005-06-30 Thread Mandus
Wed, 29 Jun 2005 08:33:58 -0700 skrev Scott David Daniels: > Mandus wrote: >> 29 Jun 2005 10:04:40 GMT skrev F. Petitjean: >> >>>Le Wed, 29 Jun 2005 09:46:15 + (UTC), Mandus a écrit : >>> >>>res = [ bb+ii*dd for bb,ii,dd in zip(b,i,d) ] >> >> seem to be a tad slower than the map, but nothing

Re: map vs. list-comprehension

2005-06-29 Thread Terry Reedy
"F. Petitjean" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >res = [ bb+ii*dd for bb,ii,dd in zip(b,i,d) ] > Hoping that zip will not be deprecated. Cease worrying. Zip was added to replace the zipping behavior of map and the idiom map(None, a, b, ...). It simultaneously alter

Re: map vs. list-comprehension

2005-06-29 Thread Scott David Daniels
Mandus wrote: > 29 Jun 2005 10:04:40 GMT skrev F. Petitjean: > >>Le Wed, 29 Jun 2005 09:46:15 + (UTC), Mandus a écrit : >> >>res = [ bb+ii*dd for bb,ii,dd in zip(b,i,d) ] > > seem to be a tad slower than the map, but nothing serious. Guess it's > the extra zip. You could try timing it using i

Re: map vs. list-comprehension

2005-06-29 Thread George Sakkis
"Carl Banks" <[EMAIL PROTECTED]> wrote in message > Fear not, people: just as the BDFL does not indiscriminately add > features, also he does not indiscriminately remove them. zip, though > it feels a little exotic, is very useful and serves a purpose that no > language feature serves(*), so rest

Re: map vs. list-comprehension

2005-06-29 Thread Carl Banks
F. Petitjean wrote: > Le Wed, 29 Jun 2005 09:46:15 + (UTC), Mandus a écrit : > > Hi there, > > > > inspired by a recent thread where the end of reduce/map/lambda in Python was > > discussed, I looked over some of my maps, and tried to convert them to > > list-comprehensions. > > > > This one I

Re: map vs. list-comprehension

2005-06-29 Thread Mandus
29 Jun 2005 10:04:40 GMT skrev F. Petitjean: > Le Wed, 29 Jun 2005 09:46:15 + (UTC), Mandus a écrit : >> Hi there, >> >> inspired by a recent thread where the end of reduce/map/lambda in Python was >> discussed, I looked over some of my maps, and tried to convert them to >> list-comprehensions.

Re: map vs. list-comprehension

2005-06-29 Thread Björn Lindström
"F. Petitjean" <[EMAIL PROTECTED]> writes: > res = [ bb+ii*dd for bb,ii,dd in zip(b,i,d) ] > > Hoping that zip will not be deprecated. Nobody has suggested that. The ones that are planned to be removed are lambda, reduce, filter and map. Here's GvR's blog posting that explains the reasons: http:

Re: map vs. list-comprehension

2005-06-29 Thread F. Petitjean
Le Wed, 29 Jun 2005 09:46:15 + (UTC), Mandus a écrit : > Hi there, > > inspired by a recent thread where the end of reduce/map/lambda in Python was > discussed, I looked over some of my maps, and tried to convert them to > list-comprehensions. > > This one I am not sure how to conver: > > Given

map vs. list-comprehension

2005-06-29 Thread Mandus
Hi there, inspired by a recent thread where the end of reduce/map/lambda in Python was discussed, I looked over some of my maps, and tried to convert them to list-comprehensions. This one I am not sure how to conver: Given three tuples of length n, b,i and d, I now do: map(lambda bb,ii,dd: bb+i