Re: The meaning of "=" (Was: tough-to-explain Python)

2009-07-14 Thread Lawrence D'Oliveiro
In message , Steven D'Aprano wrote: > Are we supposed to interpret that post as Dumb Insolence or just Dumb? "Insolence" indeed ... another wanker to plonk, I think. -- http://mail.python.org/mailman/listinfo/python-list

Re: The meaning of "=" (Was: tough-to-explain Python)

2009-07-13 Thread Steven D'Aprano
On Mon, 13 Jul 2009 23:22:36 +1200, Lawrence D'Oliveiro wrote: [stupidity omitted] > Nope, still doesn't work... Are we supposed to interpret that post as Dumb Insolence or just Dumb? -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: The meaning of "=" (Was: tough-to-explain Python)

2009-07-13 Thread Lawrence D'Oliveiro
In message , Aahz wrote: > In article , > Lawrence D'Oliveiro wrote: >>In message , Aahz wrote: >>> >>> It helps to remember that names and namespaces are in many >>> ways syntactic sugar for dicts or lists. >> >>Interesting, though, that Python insists on maintaining a distinction >>between c["

Re: The meaning of "=" (Was: tough-to-explain Python)

2009-07-11 Thread Aahz
In article , Lawrence D'Oliveiro wrote: >In message , Aahz wrote: >> >> It helps to remember that names and namespaces are in many >> ways syntactic sugar for dicts or lists. > >Interesting, though, that Python insists on maintaining a distinction >between c["x"] and c.x, whereas JavaScript does

Re: The meaning of "=" (Was: tough-to-explain Python)

2009-07-11 Thread greg
Lawrence D'Oliveiro wrote: Interesting, though, that Python insists on maintaining a distinction between c["x"] and c.x, whereas JavaScript doesn't bother. And that distinction is a good thing. It means, for example, that dictionaries can have methods without colliding with the key space of th

Re: The meaning of "=" (Was: tough-to-explain Python)

2009-07-11 Thread Lawrence D'Oliveiro
In message , Aahz wrote: > It helps to remember that names and namespaces are in many > ways syntactic sugar for dicts or lists. Interesting, though, that Python insists on maintaining a distinction between c["x"] and c.x, whereas JavaScript doesn't bother. -- http://mail.python.org/mailman/li

Re: The meaning of "=" (Was: tough-to-explain Python)

2009-07-10 Thread Aahz
[excessive quoting ahead, I'm too tired to trim] In article , kj wrote: >In a...@pythoncraft.com (Aahz) writes: >>In article , kj wrote: >>> >>>OK, so, scratching from my original post the case >>> >>>. = >>> >>>(as being a special case of = ), still, >>>to the extent that I understand your

Re: The meaning of "=" (Was: tough-to-explain Python)

2009-07-09 Thread Lawrence D'Oliveiro
In message , kj wrote: > .., Lundh writes: > > Assignment statements modify namespaces, not objects. >>> a = [3] >>> b = a These may indeed modify a namespace, not any object. However: >>> a[:] = [4] >>> a [4] >>> b [4] What change has happened to the namespace

Re: The meaning of "=" (Was: tough-to-explain Python)

2009-07-08 Thread Terry Reedy
kj wrote: To clarify, this comes from my reading of Fredrik Lundh's pages "Python Objects" (http://effbot.org/zone/python-objects.htm) and "Call By Object" (http://effbot.org/zone/call-by-object.htm). [snip] [END OF LENGTHY QUOTE] Therefore, extending just a bit beyond Lundh's explanation, if

Re: The meaning of "=" (Was: tough-to-explain Python)

2009-07-08 Thread kj
In a...@pythoncraft.com (Aahz) writes: >In article , kj wrote: >> >>OK, so, scratching from my original post the case >> >>. = >> >>(as being a special case of = ), still, >>to the extent that I understand your post, the "=" in >> >> x = 1 >> >>means something fundamentally different (in ter

Re: The meaning of "=" (Was: tough-to-explain Python)

2009-07-08 Thread Aahz
In article , kj wrote: > >OK, so, scratching from my original post the case > >. = > >(as being a special case of = ), still, >to the extent that I understand your post, the "=" in > > x = 1 > >means something fundamentally different (in terms of Python's >underlying implementation) from the "

Re: The meaning of "=" (Was: tough-to-explain Python)

2009-07-08 Thread Aahz
In article <0778f257-d36c-4e13-93ea-bf8d448c8...@b15g2000yqd.googlegroups.com>, Paul Boddie wrote: > >Almost. The latter can modify namespaces - the objects themselves - >but through properties or dynamic attribute access, they may choose >not to modify such a namespace. Really, we can phrase ass

Re: The meaning of "=" (Was: tough-to-explain Python)

2009-07-08 Thread kj
In <0778f257-d36c-4e13-93ea-bf8d448c8...@b15g2000yqd.googlegroups.com> Paul Boddie writes: >On 8 Jul, 16:04, kj wrote: >> >> =A0 =3D >> >> and not to those like, for example, >> >> =A0 [] =3D >> >> or >> >> =A0 . =3D >> >> The former are syntatic sugar for certain namespace modifications >>

Re: The meaning of "=" (Was: tough-to-explain Python)

2009-07-08 Thread Paul Boddie
On 8 Jul, 16:04, kj wrote: > >   = > > and not to those like, for example, > >   [] = > > or > >   . = > > The former are syntatic sugar for certain namespace modifications > that leave objects unchanged.  The latter are syntactic sugar for > certain object-modifying method calls that leave na

The meaning of "=" (Was: tough-to-explain Python)

2009-07-08 Thread kj
In kj writes: >I had not realized how *profoundly* different the meaning of the >"=" in Python's > spam = ham >is from the "=" in its > spam[3] = ham[3] To clarify, this comes from my reading of Fredrik Lundh's pages "Python Objects" (http://effbot.org/zone/python-objects.htm) and "Call B