Status of side-effecting functions in python

Grant Edwards invalid at invalid.invalid
Mon Oct 27 10:22:38 EDT 2014


On 2014-10-25, Wolfgang Maier <wolfgang.maier at biologie.uni-freiburg.de> 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"!!



More information about the Python-list mailing list