Thanks guys,
Yes this is exactly what's going wrong ...
Sorry, my question missed the essential "NOT",
here is an example, that behaves different in Delphi,
(so I guess Delphi is not a real language ;-)
<Python>
def Some_Function (const):
print 'Ive been here', const
return True
A = True
if A and Some_Function (4 ):
print 'I knew it was True'
else:
print 'I''ll never print this'
</Python>
<Output>
Ive been here 4
I knew it was True
</Output
I was expected that the function would not be called,
because A is True.
And I agree with Laurent that it should be better to write a clean code,
so it doesn't matter whether you write in Python or in Delphi.
Gabriel: you pointed me to this page:
The exact behavior is defined in the Language Reference
<
http://docs.python.org/ref/Booleans.html>
<quote>
or_test ::= and_test | or_test "or" and_test
</quote
Can you imagine, while I'm not a programmer, just a human,
that I don't understand one bit of this line.
So now I'm left with just one question:
for bitwise operations I should use &, |, ^
for boolean operations I should use and, or, xor
but after doing some test I find strange effects:
5
So if I use the bitwise operation on integers,
"and" changes into (bitwise) "or" and vise versa.