Re: strange for loop construct

2007-01-07 Thread Gabriel Genellina
On 7 ene, 18:52, "Dustan" <[EMAIL PROTECTED]> wrote: > Shouldn't that same page be found on the python > website?http://www.python.org/doc/2.0/ > Any clue as to why it isn't? For 2.0 it's on http://www.python.org/download/releases/2.0/new-python.htm For later ones, it's on http://www.python.org/

Re: strange for loop construct

2007-01-07 Thread Dustan
Mark Elston wrote: > * Gabriel Genellina wrote (on 1/5/2007 12:49 PM): > > At Friday 5/1/2007 17:39, [EMAIL PROTECTED] wrote: > > > >> wordfreq = [wordlist.count(p) for p in wordlist] > >> > >> I would expect > >> > >> for p in wordlist: > >> wordfreq.append(wordlist.count(p)) > >> > >> > >> I

Re: strange for loop construct

2007-01-07 Thread Jorge Godoy
[EMAIL PROTECTED] writes: > Gabriel> Where do you find the "What's new" for previous releases? I > Gabriel> have to read them online. > >> > >> Google for > >> > what's new site:python.org > > Sorry, I took "I have to read them online" to mean that you needed to read > the

Re: strange for loop construct

2007-01-07 Thread skip
Gabriel> Where do you find the "What's new" for previous releases? I Gabriel> have to read them online. >> >> Google for >> > what's new site:python.org Sorry, I took "I have to read them online" to mean that you needed to read them online because (perhaps) you don't have

Re: strange for loop construct

2007-01-07 Thread Gabriel Genellina
On 7 ene, 16:34, [EMAIL PROTECTED] wrote: > Gabriel> Where do you find the "What's new" for previous releases? I > Gabriel> have to read them online. > > Google for > > what's new site:python.org That's what I do. But this post: > If you have a Python installation you should be able

Re: strange for loop construct

2007-01-07 Thread skip
Gabriel> Where do you find the "What's new" for previous releases? I Gabriel> have to read them online. Google for what's new site:python.org Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: strange for loop construct

2007-01-07 Thread Gabriel Genellina
Mark Elston ha escrito: > If you have a Python installation you should be able to find the > "Whats New" section of the docs. List comprehensions are described > pretty well in the "What's new in Python 2.0?" section. This gives > some simple examples as well as the rationale behind them. Where

Re: strange for loop construct

2007-01-05 Thread Mark Elston
* Gabriel Genellina wrote (on 1/5/2007 12:49 PM): > At Friday 5/1/2007 17:39, [EMAIL PROTECTED] wrote: > >> wordfreq = [wordlist.count(p) for p in wordlist] >> >> I would expect >> >> for p in wordlist: >> wordfreq.append(wordlist.count(p)) >> >> >> I didn't know you could have an expression i

Re: strange for loop construct

2007-01-05 Thread Gabriel Genellina
At Friday 5/1/2007 17:39, [EMAIL PROTECTED] wrote: wordfreq = [wordlist.count(p) for p in wordlist] I would expect for p in wordlist: wordfreq.append(wordlist.count(p)) I didn't know you could have an expression in the same line. That's known as a "list comprehension" and is roughly eq

strange for loop construct

2007-01-05 Thread Sardaukary
I was googling for an example of the classic word frequency program in Python as I'm just learning the language, and wanted to see how other people implemented it. I found this blog post http://digitalhistory.uwo.ca/dhh/index.php/2006/08/20/easy-pieces-in-python-word-frequencies/ (with a much more