Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Coroutines

Coroutines provide a powerful programming paradigm for functions that preserve state between invocations.

What is it?

  1. coroutine.py: implements a coroutine my_printer that can can be "created" by invocating the function, "started" using the next() method, "invoked" using the send() method, and terminated using the close() method.
  2. longest_run.py: stateful streaming parser implemented using a coroutine. It keeps track of the longest run of characters in a string that is presented one batch at the time.
  3. stats.py: coroutine implementation for collecting statistics (mean, standard deviation).
  4. data.txt: data file to compute statistical measures from.