Re: Generator Frustration

2011-06-20 Thread Joel
On Jun 20, 9:42 pm, Terry Reedy wrote: > > A nomenclature note: a function with yield is a 'generator function'. It > is an instance of the 'function' class, same as for any other def > statement (or lambda expression). It returns an instance of class > 'generator, as you note here > >  > and wil

Re: Generator Frustration

2011-06-20 Thread Terry Reedy
On 6/20/2011 6:04 PM, Joel wrote: On Jun 4, 2:27 pm, "TommyVee" wrote: I'm using the SimPy package to run simulations. Anyone who's used this package knows that the way it simulates process concurrency is through the clever use of yield statements. Some of the code in my programs is very comple

Re: Generator Frustration

2011-06-20 Thread Joel
On Jun 4, 2:27 pm, "TommyVee" wrote: > I'm using the SimPy package to run simulations. Anyone who's used this > package knows that the way it simulates process concurrency is through the > clever use of yield statements. Some of the code in my programs is very > complex and contains several repeat

Re: Generator Frustration

2011-06-07 Thread TommyVee
"Thomas Rachel" wrote in message news:isi5dk$8h1$1...@r03.glglgl.eu... Am 04.06.2011 20:27 schrieb TommyVee: I'm using the SimPy package to run simulations. Anyone who's used this package knows that the way it simulates process concurrency is through the clever use of yield statements. Some of

Re: Generator Frustration

2011-06-06 Thread Thomas Rachel
Am 04.06.2011 20:27 schrieb TommyVee: I'm using the SimPy package to run simulations. Anyone who's used this package knows that the way it simulates process concurrency is through the clever use of yield statements. Some of the code in my programs is very complex and contains several repeating se

Re: Generator Frustration

2011-06-05 Thread TommyVee
"Gregory Ewing" wrote in message news:95059efur...@mid.individual.net... Steven D'Aprano wrote: A nice piece of syntax that has been proposed for Python is "yield from", which will do the same thing, but you can't use that yet. Unless you're impatient enough to compile your own Python with m

Re: Generator Frustration

2011-06-05 Thread Jan Decaluwe
On 06/04/2011 08:27 PM, TommyVee wrote: I'm using the SimPy package to run simulations. Anyone who's used this package knows that the way it simulates process concurrency is through the clever use of yield statements. Some of the code in my programs is very complex and contains several repeating

Re: Generator Frustration

2011-06-04 Thread Jack Diederich
On Sat, Jun 4, 2011 at 9:43 PM, Gregory Ewing wrote: > Steven D'Aprano wrote: > >> A nice piece of syntax that has been proposed for Python is "yield from", >> which will do the same thing, but you can't use that yet. You can also patch the library to always return lists instead of generators. d

Re: Generator Frustration

2011-06-04 Thread Gregory Ewing
Steven D'Aprano wrote: A nice piece of syntax that has been proposed for Python is "yield from", which will do the same thing, but you can't use that yet. Unless you're impatient enough to compile your own Python with my patch applied: http://www.cosc.canterbury.ac.nz/greg.ewing/python/yield-

Re: Generator Frustration

2011-06-04 Thread Steven D'Aprano
On Sat, 04 Jun 2011 14:27:32 -0400, TommyVee wrote: > I'm using the SimPy package to run simulations. Anyone who's used this > package knows that the way it simulates process concurrency is through > the clever use of yield statements. Some of the code in my programs is > very complex and contains