On Tue, Mar 2, 2021 at 5:51 AM Alan Gauld via Python-list <python-list@python.org> 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 curious. I haven't seen > this before: > > yield from () > > What is it doing? > What do the () represent in this context? >
It's yielding all the elements in an empty tuple. Which is none of them, meaning that - for this simple example - iterating over the object will produce zero results. ChrisA -- https://mail.python.org/mailman/listinfo/python-list