Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: Status of side-effecting functions in python Date: Mon, 27 Oct 2014 14:22:38 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 20 Message-ID: References: NNTP-Posting-Host: 67-130-15-94.dia.static.qwest.net X-Trace: reader1.panix.com 1414419758 10508 67.130.15.94 (27 Oct 2014 14:22:38 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Mon, 27 Oct 2014 14:22:38 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.python:79784 On 2014-10-25, Wolfgang Maier wrote: > It may be rare to use an expression both for its side-effects and its > return value, It's actually quite common. For example: f = open("filename") d = f.readline() In both of those lines, the side effects and return values are equally vital. The same applies to reading from a queue, popping from a stack, etc. -- Grant Edwards grant.b.edwards Yow! This PORCUPINE knows at his ZIPCODE ... And he has gmail.com "VISA"!!