Official definition of call-by-value (Re: Finding the instance reference...)

Derek Martin code at pizzashack.org
Sun Nov 16 04:29:01 EST 2008


On Sun, Nov 16, 2008 at 08:38:25AM +0000, Steven D'Aprano wrote:
> I believe that the language reference says that objects have an identity, 
> a type and state, but I'm too lazy too look it up. I'd be happy with that 
> definition.

They do indeed say value, not state.  As I said in a different
message, I'd agree that it's not a very clear definition.

> > I don't see how saying "the value of an object is itself" is
> > particularly useful.  We already have a word for what an object is, it
> > is "object". :-) 
> 
> I didn't say it was very useful. As far as I'm concerned, asking what the 
> value of an object is is not a useful question.

Now we agree. :)

> > The result of x==y depends solely on the behavior (methods) of x.
> 
> Nonsense.

It's wrong to say *solely*, but the value of x==y does indeed depend
on the behavior of the methods.

> I think the value of x is "a thing which claims to be equal to
> everything on Tuesdays, and equal to nothing every other day".

That isn't its *VALUE* -- it's its *IDENTITY*.  My weight is not my
identity... but in a certain context, it could be considered my value.
 
-- 
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20081116/e677aa70/attachment-0001.sig>


More information about the Python-list mailing list