Naming a Python module "if.py" doesn't seem to work with Python 2.2. I haven't gone back to any older versions to see if and when this happened.
I renamed the module to "if_sample.py" and imported it, and got the expected results.
What does c01:if.py mean? (I know it means chapter 1, if.py,
but a different way of indicating files would be better.
How about:
Program Name: if.py
Chapter 1
Interactive Session: if
Chapter 1
I guess what confused me right off, is that you look like
you're doing an interactive session (ending with #:~). But
I don't know any systems that use that style of prompt (well,
maybe if you're running bash as root in your home directory :)
It looks like you're cat'ing the file, but you just show
the name. If you're adding a comment that that is the name
of the file, then say so.
I'll stop blathering here..
The blue highlighting of the keyword 'if' in the first line seems quite out of place.
In _Thinking_in_Java_, at least the HTML version I have, all of the comment lines are highlighted in green, which makes for a much more readable style.
This is a REALLY POOR example. No, it's worse. It's the stupidest bit of code. let x = yes, then if x == yes ???
and if.py can't be used, if is a keyword, can't be used for modules.
oh well...