Re: at what complexity, a comparison fails ?



On Mon, 31 Dec 2007 11:45:55 +0100, Stef Mientki wrote:

hello,

I had a program that worked perfectly well. In this program modules were
dynamically added, just by putting the file in a predefined directory.

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.

What do you mean "stopped working"?


So it seems that comparing a too complex value isn't allowed. the
variable was something like:

A = [ <ndarray>, <ndarray>, ..., [<color>,<color>,...], [<float>,
<float>, ... ] ]

Doesn't seem complex to me, and I daresay probably not to Python either
-- although a lot depends on what "ndarray" and "colour" are.


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 "crashes"? Explain please.



It does seems to work, if A only contains 1 array.

Why am I not allowed to compare A and A_prev ?? And in general, how
complex might a list be to make a valid comparison, or what are the
rules ?

As complicated as you like.



--
Steven
.



Relevant Pages

  • at what complexity, a comparison fails ?
    ... In this program modules were dynamically added, ... then the program stopped working, without generating exceptions. ... So it seems that comparing a too complex value isn't allowed. ...
    (comp.lang.python)
  • Re: Great circle calculation, 2. try
    ... -> that crashes my function and I do not know how to catch that ... If so, then your zero ... Remember the caveat concerning precision and comparing to absolute ...
    (comp.lang.basic.misc)
  • Re: What will Save Film?
    ... crashes and burns off the cliff... ... Comparing film to digital is unfair unless you admit that the digital ...
    (rec.photo.digital)
  • Re: Two Options: which to choose?
    ... comparing to two- or three-day uptime periodic when it crashes. ... after removing IPF I did not get any crash. ... To unsubscribe, ...
    (freebsd-stable)
  • Re: at what complexity, a comparison fails ?
    ... without generating exceptions. ... So it seems that comparing a too complex value isn't allowed. ... Lists are compared element wise. ...
    (comp.lang.python)