<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: generators</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/generators.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2021-05-02T02:49:51+00:00</updated><author><name>Simon Willison</name></author><entry><title>Query Engines: Push vs. Pull</title><link href="https://simonwillison.net/2021/May/2/query-engines-push-vs-pull/#atom-tag" rel="alternate"/><published>2021-05-02T02:49:51+00:00</published><updated>2021-05-02T02:49:51+00:00</updated><id>https://simonwillison.net/2021/May/2/query-engines-push-vs-pull/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://justinjaffray.com/query-engines-push-vs.-pull/"&gt;Query Engines: Push vs. Pull&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Justin Jaffray (who has worked on Materialize) explains the difference between push and pull query execution engines using some really clear examples built around JavaScript generators.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://news.ycombinator.com/item?id=27006476"&gt;Hacker News&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/databases"&gt;databases&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generators"&gt;generators&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/javascript"&gt;javascript&lt;/a&gt;&lt;/p&gt;



</summary><category term="databases"/><category term="generators"/><category term="javascript"/></entry><entry><title>Generator Tricks for Systems Programmers</title><link href="https://simonwillison.net/2019/Apr/9/generator-tricks-for-systems-programmers/#atom-tag" rel="alternate"/><published>2019-04-09T17:13:48+00:00</published><updated>2019-04-09T17:13:48+00:00</updated><id>https://simonwillison.net/2019/Apr/9/generator-tricks-for-systems-programmers/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/dabeaz/generators"&gt;Generator Tricks for Systems Programmers&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
David Beazley’s definitive generators tutorial from 2008, updated for Python 3.7 in October 2018.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/python_tip/status/1115630193702395904"&gt;@python_tip&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/david-beazley"&gt;david-beazley&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generators"&gt;generators&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;&lt;/p&gt;



</summary><category term="david-beazley"/><category term="generators"/><category term="python"/></entry><entry><title>Twisted inlineCallbacks and deferredGenerator</title><link href="https://simonwillison.net/2009/Oct/25/twisted/#atom-tag" rel="alternate"/><published>2009-10-25T23:30:20+00:00</published><updated>2009-10-25T23:30:20+00:00</updated><id>https://simonwillison.net/2009/Oct/25/twisted/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://blog.mekk.waw.pl/archives/14-Twisted-inlineCallbacks-and-deferredGenerator.html"&gt;Twisted inlineCallbacks and deferredGenerator&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
inlineCallbacks are a brilliant (but seemingly under-promoted) feature of Twisted which use the ability to return a value from a yield statement to make asynchronous callbacks look much more like regular sequential programming.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/async"&gt;async&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/callbacks"&gt;callbacks&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generators"&gt;generators&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/twisted"&gt;twisted&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/yield"&gt;yield&lt;/a&gt;&lt;/p&gt;



</summary><category term="async"/><category term="callbacks"/><category term="generators"/><category term="python"/><category term="twisted"/><category term="yield"/></entry><entry><title>Diesel</title><link href="https://simonwillison.net/2009/Sep/23/diesel/#atom-tag" rel="alternate"/><published>2009-09-23T17:15:42+00:00</published><updated>2009-09-23T17:15:42+00:00</updated><id>https://simonwillison.net/2009/Sep/23/diesel/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://dieselweb.org/lib/"&gt;Diesel&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Yet Another Asynchronous Python Comet Library, of interest because this is the first one I’ve seen that uses Python’s generator coroutines, taking advantage of the return value of the yield statement to feed messages in to a generator function. Currently only works on Python 2.6 on Linux due to a dependency on 2.6’s epoll support.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/async"&gt;async&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/comet"&gt;comet&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/diesel"&gt;diesel&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generators"&gt;generators&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;&lt;/p&gt;



</summary><category term="async"/><category term="comet"/><category term="diesel"/><category term="generators"/><category term="python"/></entry><entry><title>A Curious Course on Coroutines and Concurrency</title><link href="https://simonwillison.net/2009/Apr/24/coroutines/#atom-tag" rel="alternate"/><published>2009-04-24T10:58:42+00:00</published><updated>2009-04-24T10:58:42+00:00</updated><id>https://simonwillison.net/2009/Apr/24/coroutines/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.dabeaz.com/coroutines/index.html"&gt;A Curious Course on Coroutines and Concurrency&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
David Beazley’s sequel to last year’s mind-expanding “Generator Tricks for System Programmers”, perfect for if you’ve ever puzzled over what exactly you can use Python’s generator-based coroutine support for.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/concurrency"&gt;concurrency&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/coroutines"&gt;coroutines&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/david-beazley"&gt;david-beazley&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generators"&gt;generators&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;&lt;/p&gt;



</summary><category term="concurrency"/><category term="coroutines"/><category term="david-beazley"/><category term="generators"/><category term="python"/></entry><entry><title>Python + Hadoop = Flying Circus Elephant</title><link href="https://simonwillison.net/2008/May/31/lastfm/#atom-tag" rel="alternate"/><published>2008-05-31T14:14:56+00:00</published><updated>2008-05-31T14:14:56+00:00</updated><id>https://simonwillison.net/2008/May/31/lastfm/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://blog.last.fm/2008/05/29/python-hadoop-flying-circus-elephant"&gt;Python + Hadoop = Flying Circus Elephant&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Last.fm have released Dumbo, a Python module that lets you easily write Hadoop map/reduce tasks using Python and generators.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/dumbo"&gt;dumbo&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generators"&gt;generators&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hadoop"&gt;hadoop&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/lastfm"&gt;lastfm&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/mapreduce"&gt;mapreduce&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;&lt;/p&gt;



</summary><category term="dumbo"/><category term="generators"/><category term="hadoop"/><category term="lastfm"/><category term="mapreduce"/><category term="python"/></entry><entry><title>Generator Tricks for Systems Programmers</title><link href="https://simonwillison.net/2008/Apr/24/generators/#atom-tag" rel="alternate"/><published>2008-04-24T10:17:07+00:00</published><updated>2008-04-24T10:17:07+00:00</updated><id>https://simonwillison.net/2008/Apr/24/generators/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.dabeaz.com/generators/index.html"&gt;Generator Tricks for Systems Programmers&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
The best tutorial on Python’s powerful generator feature I’ve seen anywhere.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/david-beazley"&gt;david-beazley&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/generators"&gt;generators&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;&lt;/p&gt;



</summary><category term="david-beazley"/><category term="generators"/><category term="python"/></entry></feed>