Is 'everything' a refrence or isn't it?
fakeaddress at nowhere.org
Fri Jan 13 14:54:35 EST 2006
Sybren Stuvel wrote:
> Mike Meyer enlightened us with:
>>>I think type 'object' has only one value, so that's it.
>>In that case, they should all be equal, right?
>>>>>object() == object()
> You compare instances of the type 'object'. They both have one value:
> <object object at 0xb7ddb438>
> <object object at 0xb7ddb440>
> So the claim "type 'object' has only one value" is true. It's just not
> the same value for all instances.
No, that's not the issue. A type has a set of values (and a set of
operations); each instance takes one value from the type's set. I
think (I'm not sure) that object's set of values has only one element.
In Python, types are extensible, so by 'instance', I mean a direct
instance, not an instance of a class that inherits from 'object'.
Would it make sense to have a type with an empty set of values?
Sure. Such a type could never have a direct instance. Perhaps
'object' should be an abstract base class.
More information about the Python-list