Is 'everything' a refrence or isn't it?
Steven D'Aprano
steve at REMOVETHIScyber.com.au
Sun Jan 15 05:47:02 EST 2006
On Sun, 15 Jan 2006 10:48:22 +0100, Fredrik Lundh wrote:
> an object's identity, type, and value are three different
> and distinct things. the identity and type are not part of the value. the
> type controls *how* to access the value, and needs to be known *before*
> you can access the value.
(Not arguing, just trying to clarify your point.)
I'm sick of arguing about object, let's use a different example:
>>> id(None)
135289128
>>> type(None)
<type 'NoneType'>
What's the value of None? Would you say "it has no value" or "it's value
is None" or something else?
None is a singleton, so it is meaningless to ask about two instances of
NoneType. How about this?
>>> class Empty:
... pass
...
>>> id(Empty())
-151107636
>>> type(Empty())
<type 'instance'>
Do two instances of Empty have the same value, or is the question
meaningless?
--
Steven.
More information about the Python-list
mailing list