boolean OR gotcha

1

1x7y2z9

True

Yes, this is explained in the docs:
The expression x or y first evaluates x; if x is true, its value is
returned; otherwise, y is evaluated and the resulting value is
returned.

Another one (also explainable):True
# Above is same as (operator precedence):True
# Here is something different:False
 
J

Jan Kaliszewski

04-08-2009 o 22:11:18 1x7y2z9 said:
Another one (also explainable):
True
# Above is same as (operator precedence):
True
# Here is something different:
False

I don't see any problem here.

The last is ok: None != 0.

*j
 
1

1x7y2z9

Did not intend that there was a problem.
Just a gotcha or a fun little titbit ... maybe. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top