I am out of trial and error again Lists

Rustom Mody rustompmody at gmail.com
Sat Oct 25 19:24:39 CEST 2014


On Saturday, October 25, 2014 1:15:09 PM UTC+5:30, Steven D'Aprano wrote:
> Rustom Mody wrote:
> 
> > On Saturday, October 25, 2014 11:20:03 AM UTC+5:30, Chris Angelico wrote:
> >> On Sat, Oct 25, 2014 at 4:40 PM, Rustom Mody  wrote:
> >> > Its generally accepted that side-effecting functions are not a good
> >> > idea -- typically a function that returns something and changes global
> >> > state.
> >> 
> >> Only in certain circles. Not in Python. There are large numbers of
> >> functions with side effects (mutator methods like list.append,
> >> anything that needs lots of state like random.random, everything with
> >> external effect like I/O, heaps of stuff), and it is most definitely
> >> not frowned upon.
> >> 
> >> In Python 3 (or Python 2 with the future directive), print is a
> >> function, print() an expression. It's not "semantically a statement".
> > 
> > Ok
> > So give me a valid (ie useful) use where instead of the usual
> > l=[1,2,3]
> > l.append(4)
> > 
> > we have
> > 
> > foo(l.append(4))
> 
> Your question seems to be non-sequitor. To me, it doesn't appear to have any
> relationship to Chris' comments.

I am going to leave undisturbed Seymore's thread for whom these nit-picks are unlikely to be helpful

Answer in another one



More information about the Python-list mailing list