On 12/05/2019 03:11 PM, Josh Rosenberg wrote:
"Also, the for-loop version quits the moment it finds a Product type, while the
`first` version has to first process the entire jsonld_items structure."
The first version doesn't have to process the whole structure; it's written
with a generator expression, so it only tests and produces values on demand,
and next stops demanding them as soon as it gets a single result.
Ah, thanks. My genexp foo is weak. :(
--
~Ethan~
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@python.org/message/S5OTRK3SKWNES6FKRUZ344MALEFFWMVJ/
Code of Conduct: http://python.org/psf/codeofconduct/