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

Mike Meyer mwm at mired.org
Sat Jan 14 23:13:05 EST 2006


Bryan Olson <fakeaddress at nowhere.org> writes:
> Mike Meyer wrote:
>> Bryan Olson <fakeaddress at nowhere.org> writes:
>>>Mike Meyer wrote:
>>>>Bryan Olson writes:
>>>>>rurpy at yahoo.com wrote:
>>>>>>The reason is that I am still trying to figure out
>>>>>>what a value is myself.  Do all objects have values?
>>>>>Yes.
>>>>Can you justify this, other than by quoting the manual whose problems
>>>>caused this question to be raised in the first place?
>>>
>>>The Python manual's claim there is solidly grounded. The logic
>>>of 'types' is reasonably well-defined in the discipline. Each
>>>instance of a type takes exactly one element from the type's
>>>set of values (at least at a particular time).
>> References?
> Are not hard to find.

Well, Google didn't turn anything up. On the other hand, "object" and
"value" are pretty poor terms to google with. Maybe you can suggest
better ones?

> In Niklaus Wirth's /Algorithms + Data
> Structures = Programs", the first section after "introduction"
> "The concept of data type".

It's been a few decades since I read that, but I don't recall anything
that prohibited a valueless instance. My copy is in storage, so I
can't really double check it. Care to quote the relevant segment that
says that objects have to have a value?

> Wikipedia has reasonable articles on datatype and abstract
> datatype. That an instance takes a value is too obvious to state,
> but clearly implied by discussion of an object's value.

I obviously disagree that it's too obvious to state. Just because most
instances of objects have a value doesn't necessarily mean that every
instance of an object has a value. The discussion on these wikipedia
pages don't say anything that would imply that an object must have a
value.

> If you're familiar with other programming
> languages, you can to those. There are no values of C's 'void'
> type, and consequently there are never any objects of type void.

But we're not talking about C, we're talking about Python.

>>>>>>What the value of object()?  A few weeks ago I turned
>>>>>>to that page for enlightenment, with the results I reported.
>>>>>I think type 'object' has only one value, so that's it.
>>>>In that case, they should all be equal, right?
>>>>>>>object() == object()
>>>>False
>>>>Looks like they have different values to me.
>>>Whether the '==' operation conforms to your idea of what equality
>>>means is unclear.
>> Care to say what it does mean, then?
> I think that's now been answered a few times. In this case,
> it means comparison of object identity.

Ok, so the objects identity is not it's value. Otherwise, the claim
"the type object has only one value" would be false.

>>>Maybe I was wrong, and the object's identity
>>>is part of its abstract state.
>> Is abstract state always part of the value?
> The abstract state, sometimes called the "logical state", is
> the value the object represents.

So are you now claiming that all instances of object have different
values, as they all have different identities?

> The concept of a valueless object is inconsistent with a great deal
> material.

Another completely unsupported pronouncement.  *What* material? Come
on, give me *explicit* references. At the very least, provide or point
to a definition of type that makes it clear that a type for which you
can have instances *has* to have values.

    <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