From mboxrd@z Thu Jan 1 00:00:00 1970 From: itz@very.loosely.org (Ian Zimmerman) Date: Sat, 11 Nov 2017 10:05:48 -0800 Subject: [TUHS] 80 columns ... In-Reply-To: <1510421420.1505476.1169232000.0EB6B20D@webmail.messagingengine.com> References: <1510334474.27585.for-standards-violators@oclsc.org> <20171111170456.uq6tb63rtq6hkuc6@matica.foolinux.mooo.com> <1510421420.1505476.1169232000.0EB6B20D@webmail.messagingengine.com> Message-ID: <20171111180548.mef7ltlla5djkzmx@matica.foolinux.mooo.com> 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.