Message19073
Logged In: YES
user_id=21627
This is clearly not a bug. I'm closing it as "works for me":
the "and" operator does *not* evaluate its argument twice
(as Tim explains, and in contrast to what the subject claims).
That the semantics of the if statement (*not* the "and"
expression) is surprising if the result of __nonzero__
changes in subsequent invokcations might be a fact (strictly
speaking, whether you are surprised depends on what you
expect). However, the behaviour of Python is not at all
random in itself, and there are very good reasons for things
being just the way they are.
If changing zero-ness of objects surprises you: Don't do
that, then. |
|
Date |
User |
Action |
Args |
2007-08-23 14:18:22 | admin | link | issue846564 messages |
2007-08-23 14:18:22 | admin | create | |
|