Re: at what complexity, a comparison fails ?
- From: Marc 'BlackJack' Rintsch <bj_666@xxxxxxx>
- Date: 31 Dec 2007 11:12:40 GMT
On Mon, 31 Dec 2007 11:45:55 +0100, Stef Mientki wrote:
Now one of the interface mechanisms was to see if some parameter was
changed in a an instance,
by comparing the value from the instance with its previous value
This went all well, untill I added a too complex variable,
then the program stopped working, without generating exceptions.
So it seems that comparing a too complex value isn't allowed.
Then you get the wrong impression.
the variable was something like:
A = [ <ndarray>, <ndarray>, ..., [<color>,<color>,...], [<float>,
<float>, ... ] ]
So what I need was something like:
if A != A_prev :
... do something
A_prev = A
And this crashes, or at least it doesn't work but also doesn't generate
exceptions.
It does seems to work, if A only contains 1 array.
Why am I not allowed to compare A and A_prev ??
You are allowed and you do in the above code.
And in general, how complex might a list be to make a valid comparison,
or what are the rules ?
There are no rules about the complexity. Lists are compared element wise.
If the lists are of the same length and all elements at the corresponding
indexes compare equal, the lists are considered equal.
Ciao,
Marc 'BlackJack' Rintsch
.
- References:
- at what complexity, a comparison fails ?
- From: Stef Mientki
- at what complexity, a comparison fails ?
- Prev by Date: Re: Is there a string function to trim all non-ascii characters out of a string
- Next by Date: Re: Is there a string function to trim all non-ascii characters out of a string
- Previous by thread: at what complexity, a comparison fails ?
- Next by thread: Re: at what complexity, a comparison fails ?
- Index(es):
Relevant Pages
|