Philip said:
a and b
=3D> b
?
I would expect it to return true.
The pseudo-code for and basically looks like this:
a and b =3D
if a: b
else: a
This means that if a or b evaluate to a something that counts as false, the=
n=20
the whole expression will also evaluate to something that counts as false.=
=20
And if neither of them do, then the whole expression will evaluate to=20
something that counts as true. So for if-conditions etc. the expression wil=
l=20
work as expected.
The reason that it returns a/b and not true/false is that
a) there are very few cases where you need the value to be an explicit bool=
ean
b) there are quite a few cases where returning a/b is more meaningful and/o=
r=20
useful than just returning true/false (though that's more the case for "or"=
=20
than "end". Example: foo =3D ARGV[0] or default_value).
HTH,
Sebastian