Is behavior of += intentional for int?

OKB (not okblacke) brenNOSPAMbarn at
Sun Aug 30 19:43:42 CEST 2009

Derek Martin wrote:

> If Python is to say that objects have values,
> then the object can not *be* the value that it has, because that is a
> paradoxical self-reference.  It's an object, not a value.

    	But does it say that objects have values?  I don't see where you 
get this idea.  Consider this code:

class A(object):
class B(object):
    	x = 0

a = A()
b = B()
b2 = B()
b2.x = a

    	What is the "value" of the object now bound to the name "a"?  What 
about the "value" of the object bound to b, or b2?

    	I would say that in Python, objects do not have values.  Objects 
are values.

--OKB (not okblacke)
Brendan Barnwell
"Do not follow where the path may lead.  Go, instead, where there is
no path, and leave a trail."
	--author unknown

More information about the Python-list mailing list