Augument assignment versus regular assignment
Piet van Oostrum
piet at cs.uu.nl
Fri Jul 14 15:07:28 EDT 2006
>>>>> Antoon Pardon <apardon at forel.vub.ac.be> (AP) wrote:
>AP> Well I'll start on an possitive note and accept this. Now I'd like you
>AP> to answer some questions.
>AP> 1) Do you think the langauge reference makes it clear that this is how
>AP> the reader has to understand things.
Yes.
>AP> 2a) In case you answer yes to question (1). Can you explain me how
>AP> I have to read the language reference in order to deduce this
>AP> is indeed the way things should be understood.
Just read what it says. `It is only evaluated once' is quite clear I would
say. Your problem is that you thought __setitem__ is part of evaluation,
but it isn't. It is part of assignment, while __getitem__ is part of
evaluation. See the definitions of __getitem__ and __setitem__ in the
language reference manual.
--
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: piet at vanoostrum.org
More information about the Python-list
mailing list