Re: The Yield statement

2008-07-07 Thread Paul Hankin
On Jul 1, 12:45 am, Mensanator <[EMAIL PROTECTED]> wrote: > Here's an example. > ... > def partition_generator(depth,width): >   """creates all partions of a given depth,widtth (depth>=width) >   depth objects in width bins such that each bin has at least 1 object >   this function is a generator (

Re: The Yield statement

2008-07-07 Thread Jorgen Grahn
On Sun, 6 Jul 2008 00:29:26 -0700, Mark Tolonen <[EMAIL PROTECTED]> wrote: > > "inhahe" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] ... >> note that this won't work; >> def f(): >> for x in xrange(10): >>for y in xrange(10): >> yield (x,y) >> >> yield just doesn't work

Re: The Yield statement

2008-07-06 Thread Mark Tolonen
"inhahe" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] "Alex Bryan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Okay, so i don't really understand the Yield thing and i know it is useful. I've read a few things about it but it is all programming jargon and so

Re: The Yield statement

2008-07-06 Thread inhahe
"Alex Bryan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Okay, so i don't really understand the Yield thing and i know it is > useful. I've read a few things about it but it is all programming jargon > and so basically it is hard for me to understand. So can anyone give me a

Re: The Yield statement

2008-06-30 Thread John Machin
On Jul 1, 8:31 am, Alex Bryan <[EMAIL PROTECTED]> wrote: > Okay, so i don't really understand the Yield thing and i know it is > useful. I've read a few things about it but it is all programming > jargon and so basically it is hard for me to understand. So can anyone > give me a description or link

Re: The Yield statement

2008-06-30 Thread Mensanator
On Jun 30, 5:31 pm, Alex Bryan <[EMAIL PROTECTED]> wrote: > Okay, so i don't really understand the Yield thing and i know it is   > useful. I've read a few things about it but it is all programming   > jargon and so basically it is hard for me to understand. So can anyone   > give me a description

Re: The Yield statement

2008-06-30 Thread Larry Bates
Alex Bryan wrote: Okay, so i don't really understand the Yield thing and i know it is useful. I've read a few things about it but it is all programming jargon and so basically it is hard for me to understand. So can anyone give me a description or link me to a site that has a good definition an

The Yield statement

2008-06-30 Thread Alex Bryan
Okay, so i don't really understand the Yield thing and i know it is useful. I've read a few things about it but it is all programming jargon and so basically it is hard for me to understand. So can anyone give me a description or link me to a site that has a good definition and/or examples