In <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
>>> [using `map()`]
>> And has the same issue as a list comprehension if all you want is the side
>> effect of the calls: a useless temporary list full of `None`\s is build.
> 
> functoins can return a values, and you get it. I don't think that it
> is bad side effect.

I don't either.  By definition it's not a side effect at all. Side effects
are the "things that happen" besides the return values.

Warren Stringer wanted to call the functions just for the side effects
without interest in the return values.  So building a list of return
values which is immediately thrown away is a waste of time and memory.

> When you write simple
>>>> def a(): print "From Russia with love."
>>>> a()
> you have side effect too - returning "None".

No, the side effect is the printing of 'From Russia with love.'

IMHO there's a difference between this single `None` that can't be
prevented and abusing a list comprehension or `map()` just for side
effects and not for building a list with meaningful content.

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to