git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I'm wrong or Will we fix the ducks limp?


On Thursday, June 9, 2016 at 4:37:58 AM UTC+12, Marko Rauhamaa wrote:
> I see Python as doing the exact same thing with variables as C.
> 
> What is different is that in Python, every expression evaluates to a
> pointer. Thus, you can only assign pointers to variables.

Yup. I think some people are getting confused over assignment to simple variables as opposed to more complex expressions on the LHS of assignments in Python. For example, given

    a = [1, 2, 3, 4]

compare the different effects of

    b = a
    b = a[:]
    b[:] = a # assuming b already has an appropriate initial value

not to mention other possibilities...