unexpected delay in writing to standard out from python script

I'm working through the exercises for the Starter Kit with the Omega2+. I added some functionality to the temperature sensor script that allows the user to include the polling interval as an argument on the command line and added a timestamp on the output. You can see my work here: https://github.com/stonematt/omega-starterkit/tree/master/temp

seems to work fine except...
when the interval is short, like 1 or 2 seconds, the output to terminal works fine. when I used a long interval like 300 (5min), it didn't. After 10min I didn't see any values written the terminal, so I did a test...

I opened 2 terminal sessions as follows.

In the first, I ran the script w/ a 6s interval and redirected output to a file:
$ python STK08-temp-sensor.py 6 | tee -a ~/tempHistory

In the second, I ran a shell command to query the file system every 3s and record the output file's timestamp and line count:
$ while true; do date && ls -e tempHistory && wc -l tempHistory && echo ""; sleep 3; done > tempFileHistory

tempHistory eventually gets all the readings. tempFileHistory shows the script updates the file but not on every loop. The file is updated about every 3m10s where about 28 new lines are added each time. So the sensor is read and the value is held in memory, but it's not flushed to standard out each time.

Here's an abbreviated version of tempFileHistory (duplicate blocks have been deleted)

Here's a few lines out of tempHistory.
Notice many of these readings were taken between 12:12:24 and 12:15:35, I expect the python script to write this row every polling interval (6 seconds), and the line count to increment by 1 per cycle, it shouldn't be silent for 3min and suddenly write 29 lines to the file.