On 2017-11-11 12:30, Random832 wrote:
for val in iter(function, STOP):
do_something()
A neat trick, thanks.
(If the function is readline, though, you can just
iterate over the
file object)
This doesn't work if the file object can be a tty (such as stdin), IIRC
due to stdio buffering effects.
--
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
To reply privately _only_ on Usenet, fetch the TXT record for the domain.