Can a simple a==b 'hang' in and endless loop?
fuzzyman at gmail.com
Wed Jan 18 10:06:22 EST 2006
Claudio Grondi wrote:
> Steve Holden wrote:
> The problem here is, that I mean, that in Python it makes no sense to
> talk about a value of an object, because it leads to weird things when
> trying to give a definition what a value of an object is.
You're saying that C and Java get round that problem by sometimes
defining value to mean 'the memory address and object is stored at'.
That hardly seems to clarify what value *really* means, and can lead to
some interesting confusions.
Anyway - for the basic datatypes 'value' seems quite clear. It's only
not clear what this might mean in user defined classes - where value
means whatever you define it to mean.
By overloading the comparison and rich comparison methods of user
defined classes, you have the opportunity to *precisely* define the
meaning of value...
> It seems, that in Python there is a lack of operator able to compare
> there are no really such things as values, so there is no need to
> compare them.
Can you provide an example to clarify what you mean ?
All the best,
More information about the Python-list