Is 'everything' a refrence or isn't it?

Mike Meyer mwm at mired.org
Sat Jan 14 17:33:07 EST 2006


Steven D'Aprano <steve at REMOVETHIScyber.com.au> writes:
> On Sat, 14 Jan 2006 04:22:53 +0000, Donn Cave wrote:
>> |> 2. What is the value of object()?
>> [ I assume you mean, the object returned by object(). ]
>> It doesn't really have a value.  I can't think of any kind of
>> computation that could use this object directly.
> Here is one:
> obj_inst = object()
> def computation(data):
>     global obj_inst
>     if data is obj_inst:
>         print FirstOneThousandPrimes()
>     else:
>         print TextOfWarAndPeace()
> It isn't a particularly useful computation, but it is a computation.

And it doesn't use the value of the object instance, it uses it's
identity. Any type that doesn't have hacks to share instances with the
same value could be used in this way.

> Let's try not to be too deep here, okay? Before asking "what is the value
> of foo?", we have to agree on what we mean by "value". It is easy to tie
> yourself into knots here.

I think you want to settle what we mean by "type" first. Or maybe in
parallel.

        <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list