Re: yield expression

2013-02-26 Thread Dave Angel
PM, Colin J. Williams mailto:c...@ncf.ca>> wrote: On 24/02/2013 7:36 PM, Ziliang Chen wrote: Hi folks, When I am trying to understand "yield" expression in Python2.6, I did the following coding. I have difficulty understanding why "val" w

Re: yield expression

2013-02-26 Thread Colin J. Williams
ote: On 24/02/2013 7:36 PM, Ziliang Chen wrote: Hi folks, When I am trying to understand "yield" expression in Python2.6, I did the following coding. I have difficulty understanding why "val" will be "None" ? What's happenin

Re: yield expression

2013-02-26 Thread Vytas D.
+= 1 def main(): generator = counter() while True: print(next(generator)) if __name__ == '__main__': main() Hope helps. Vytas D. On Tue, Feb 26, 2013 at 4:34 PM, Colin J. Williams wrote: > On 24/02/2013 7:36 PM, Ziliang Chen wrote: > >> Hi folk

Re: yield expression

2013-02-26 Thread Dave Angel
On 02/26/2013 11:34 AM, Colin J. Williams wrote: On 24/02/2013 7:36 PM, Ziliang Chen wrote: Hi folks, When I am trying to understand "yield" expression in Python2.6, I did the following coding. I have difficulty understanding why "val" will be "None" ? What's

Re: yield expression

2013-02-26 Thread Ian Kelly
On Tue, Feb 26, 2013 at 9:34 AM, Colin J. Williams wrote: > Perhaps it's becaoue (teild count) is a statement. Statements do not return > a value. yield is a bit of an odd duck in that it's both a statement and an expression. Compare: http://docs.python.org/3/reference/simple_stmts.html#the-yi

Re: yield expression

2013-02-26 Thread Colin J. Williams
On 24/02/2013 7:36 PM, Ziliang Chen wrote: Hi folks, When I am trying to understand "yield" expression in Python2.6, I did the following coding. I have difficulty understanding why "val" will be "None" ? What's happening under the hood? It seems to me very

Re: yield expression

2013-02-24 Thread Ziliang Chen
On Monday, February 25, 2013 8:51:28 AM UTC+8, Oscar Benjamin wrote: > On 25 February 2013 00:39, Ziliang Chen wrote: > > > Hi folks, > > > When I am trying to understand "yield" expression in Python2.6, I did the > > following coding. I have difficulty

yield expression

2013-02-24 Thread Ziliang Chen
Hi folks, When I am trying to understand "yield" expression in Python2.6, I did the following coding. I have difficulty understanding why "val" will be "None" ? What's happening under the hood? It seems to me very time the counter resumes to execute, it wi

Re: yield expression

2013-02-24 Thread Oscar Benjamin
On 25 February 2013 00:39, Ziliang Chen wrote: > Hi folks, > When I am trying to understand "yield" expression in Python2.6, I did the > following coding. I have difficulty understanding why "val" will be "None" ? > What's happening under the hoo

yield expression

2013-02-24 Thread Ziliang Chen
Hi folks, When I am trying to understand "yield" expression in Python2.6, I did the following coding. I have difficulty understanding why "val" will be "None" ? What's happening under the hood? It seems to me very time the counter resumes to execute, it wi

yield expression

2013-02-24 Thread Ziliang Chen
Hi folks, When I am trying to understand "yield" expression in Python2.6, I did the following coding. I have difficulty understanding why "val" will be "None" ? What's happening under the hood? It seems to me very time the counter resumes to execute, it wi

Re: yield expression programmized-formal interpretation. (interpretation of yield expression.)

2008-04-21 Thread Gabriel Genellina
En Mon, 21 Apr 2008 15:03:05 -0300, <[EMAIL PROTECTED]> escribió: What if I say oath= yield or other= yield ? Does yield evaluate without parenthes? (Eth.) You can't use yield except in a generator function. From and the grammar definit

yield expression programmized-formal interpretation. (interpretation of yield expression.)

2008-04-21 Thread castironpi
What if I say oath= yield or other= yield ? Does yield evaluate without parenthes? (Eth.) -- http://mail.python.org/mailman/listinfo/python-list