On 03/03/2021 01:01, Cameron Simpson wrote:
On 02Mar2021 15:06, Larry Martell wrote:
I discovered something new (to me) yesterday. Was writing a unit test
for generator function and I found that none of the function got
executed at all until I iterated on the return value.
Aye. Generators are
On Fri, Mar 12, 2021 at 8:20 AM Serhiy Storchaka wrote:
>
> 01.03.21 23:59, Cameron Simpson пише:
> > On 28Feb2021 23:47, Alan Gauld wrote:
> >> On 28/02/2021 00:17, Cameron Simpson wrote:
> >>> BUT... It also has a __iter__ value, which like any Box iterates over
> >>> the subboxes. For MDAT tha
01.03.21 23:59, Cameron Simpson пише:
> On 28Feb2021 23:47, Alan Gauld wrote:
>> On 28/02/2021 00:17, Cameron Simpson wrote:
>>> BUT... It also has a __iter__ value, which like any Box iterates over
>>> the subboxes. For MDAT that is implemented like this:
>>>
>>> def __iter__(self):
>>>
On 02Mar2021 15:06, Larry Martell wrote:
>I discovered something new (to me) yesterday. Was writing a unit test
>for generator function and I found that none of the function got
>executed at all until I iterated on the return value.
Aye. Generators are lazy - they don't run at all until you ask f
On Tue, Mar 2, 2021 at 2:16 PM Chris Angelico wrote:
>
> On Tue, Mar 2, 2021 at 5:51 AM Alan Gauld via Python-list
> wrote:
> >
> > On 28/02/2021 00:17, Cameron Simpson wrote:
> >
> > > BUT... It also has a __iter__ value, which like any Box iterates over
> > > the subboxes. For MDAT that is impl
On Mon, 1 Mar 2021 at 19:51, Alan Gauld via Python-list
wrote:
> Sorry, a bit OT but I'm curious. I haven't seen
> this before:
>
> yield from ()
>
> What is it doing?
> What do the () represent in this context?
It's the empty tuple.
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, Mar 2, 2021 at 5:51 AM Alan Gauld via Python-list
wrote:
>
> On 28/02/2021 00:17, Cameron Simpson wrote:
>
> > BUT... It also has a __iter__ value, which like any Box iterates over
> > the subboxes. For MDAT that is implemented like this:
> >
> > def __iter__(self):
> > yield f
On 28/02/2021 23:47, Alan Gauld via Python-list wrote:
> On 28/02/2021 00:17, Cameron Simpson wrote:
>
>> BUT... It also has a __iter__ value, which like any Box iterates over
>> the subboxes. For MDAT that is implemented like this:
>>
>> def __iter__(self):
>> yield from ()
>
> Sorr
On Wed, Mar 3, 2021 at 8:21 AM Dieter Maurer wrote:
>
> Alan Gauld wrote at 2021-2-28 23:47 +:
> >yield from ()
>
> "yield from iterator" is similar to "for i in iterator: yield i" (with
> special handling when data/exceptions are injected into the generator).
>
> Thus, "yield from ()" does es
Alan Gauld wrote at 2021-2-28 23:47 +:
>yield from ()
"yield from iterator" is similar to "for i in iterator: yield i" (with
special handling when data/exceptions are injected into the generator).
Thus, "yield from ()" does essentially nothing with the side effect
that the containing function
On 01/03/2021 00:47, Alan Gauld via Python-list wrote:
On 28/02/2021 00:17, Cameron Simpson wrote:
BUT... It also has a __iter__ value, which like any Box iterates over
the subboxes. For MDAT that is implemented like this:
def __iter__(self):
yield from ()
Sorry, a bit OT but I
On 28Feb2021 23:47, Alan Gauld wrote:
>On 28/02/2021 00:17, Cameron Simpson wrote:
>> BUT... It also has a __iter__ value, which like any Box iterates over
>> the subboxes. For MDAT that is implemented like this:
>>
>> def __iter__(self):
>> yield from ()
>
>Sorry, a bit OT but I'm cur
On 28/02/2021 00:17, Cameron Simpson wrote:
> BUT... It also has a __iter__ value, which like any Box iterates over
> the subboxes. For MDAT that is implemented like this:
>
> def __iter__(self):
> yield from ()
Sorry, a bit OT but I'm curious. I haven't seen
this before:
yield fro
13 matches
Mail list logo