On Mon, Sep 4, 2017 at 8:27 PM, Rustom Mody <rustompm...@gmail.com> wrote: > That's fine as far as it goes > But then you have people (Steven above) who feel that python passing has > no exceptions (in parameter passing) > Does a poor job AFAIAC of explaining the difference between foo and bar in > foll > >>>> def foo(x): x += 2 >>>> def bar(x): x.append(2) >>>> a=10 >>>> b=[10] >>>> foo(a) >>>> a > 10 >>>> bar(b) >>>> b > [10, 2] >>>>
It's all about assignment. In foo, you have an assignment statement; in bar, you don't. The diagram showed the behaviour of assignment. ChrisA -- https://mail.python.org/mailman/listinfo/python-list