Re: why cannot assign to function call



Steven D'Aprano <steven@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

The only tricky thing is that items 1, 2 and 3 can be inside two
different boxes at the same time. There's no obvious real world analogy
to that without the boxes being nested. This ability for objects to be in
two places at once (or even to be inside themselves!) is one of the few
reasons why Python's use of references in the implementation needs to be
mentioned.

Ahh. So it /does/ need to be mentioned after all. But you're wrong:
it's not an implementation detail: it's an essential part of the
language semantics.

A better analogy. The objects are scattered across the floor. No
object is contained in another. However, we have a plentiful supply of
bits of string, each of which is tied to a Teflon-covered paperweight at
one end and has a blob of Blu-Tack on the other. Instead of putting
something in a box directly, what we do is grab a piece of string, stick
the Blu-Tack to the thing, and put the paperweight in the box. This
way, we can stick several bits of string to the same object and put the
paperweights in different boxes. Indeed, nothing stops us sticking two
bits of string to a box, and putting both paperweights inside that same
box. But fitting a box into itself twice requires origami skills that
frighten me.

The Teflon stops the Blu-Tack from sticking to the paperweights, 'cos
you're not allowed to do that.

There's a daemon who comes around periodically and cleans up the mess of
paperweights which aren't in boxes, and tidies away things which don't
have any string stuck to them any more, but really he's just an
implementation detail and you wouldn't need him if your floor was big
enough and you had enough bits of sufficiently long string.

-- [mdw]
.



Relevant Pages

  • Re: why cannot assign to function call
    ... There's no obvious real world analogy ... to that without the boxes being nested. ... bits of string, each of which is tied to a Teflon-covered paperweight at ... bits of string to a box, and putting both paperweights inside that same ...
    (comp.lang.python)
  • Re: Search Form Results Error
    ... Are the control sources for the text boxes on the form valid? ... listedn in the Field List match the names in the text boxes on the form? ... Build up the criteria string form the non-blank search ... and apply to the form's Filter. ...
    (microsoft.public.access.formscoding)
  • Re: Search Form Results Error
    ... both the text boxes and refrences clear. ... Private Sub cmdFilter_Click ... Build up the criteria string form the non-blank search ... and apply to the form's Filter. ...
    (microsoft.public.access.formscoding)
  • Re: No smooth transition to the next form
    ... I am reading the textfile line by line. ... same string after the blank spaces. ... > I'm not sure how you're populating your combo boxes but you get the idea. ... So I am calling the same function for Saving in the ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Search Form Results Error
    ... Is the record source for the form a table or query? ... listedn in the Field List match the names in the text boxes on the form? ... Build up the criteria string form the non-blank search ... and apply to the form's Filter. ...
    (microsoft.public.access.formscoding)