On Wed, 20 May 2015 06:54 pm, Gregory Ewing wrote:
> Steven D'Aprano wrote:
>
>> Code snippet 1:
>>
>> x = [[1,2],[1,2]]
>>
>> creates a list bound to the name "x", containing a list containing ints 1
>> and 2, and a second independent list also containing ints 1 and 2.
>
> Using the word
Terry Reedy wrote:
A club
roster contains identifiers that refer to and identify the members.
Exactly: the roster "refers to" the members, rather
than "containing" them. Or equivalently, it contains
references to the members.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
On 5/20/2015 4:54 AM, Gregory Ewing wrote:
At this point the student thinks, "Um... what? How
can an object contain another object *twice*?"
If he's still thinking in physical terms, this
sentence is nonsensical.
It gets even worse with:
x = [1, 2]
x[1] = x
Now you have to say that the list c
Steven D'Aprano wrote:
Code snippet 1:
x = [[1,2],[1,2]]
creates a list bound to the name "x", containing a list containing ints 1
and 2, and a second independent list also containing ints 1 and 2.
Using the word "contains" here is misleading, because
it conjures a mental picture of phy
On Wednesday 20 May 2015 16:23, Rustom Mody wrote:
> I dont like teaching this. viz that in python
> x = [[1,2],[1,2]]
> is equal to y defined as
> z = [1,2]
> y = [z,z]
> And although they are equal as in '==' they are not equal as in behavior,
> memory usage etc, a fact that can only be elucidat