Displaying _doc_
I'm confused over the _doc_ method on page 63, Chapter 5. It says here to:
"..exit the interactive session that you entered in the last example and re-invoke ch5.py, since it now has the docstring added to in_fridge. After you do that, you can do the following:
>>>print "%s" % in_fridge._doc_
This is a function to see if the fridge has a food.
fridge has to be a dictionary defined outside of the function.
the food to be searched for is in the string wanted_food.
"
WHAT??????
When I do this, nothing happens but a syntax error.
God, you people write books? I hope the authors are fired from their writing jobs, they obviously don't know how to explain programming languages well at all.
For the record, I work on an application development team but use .NET with Visual Studio. I've heard great things about Python but so far the code editor really sucks. The explanations in this book surely do not help.
Tip to the authors: If you are going to waste time writing a book for beginners and then charge them almost $50 to buy it, then you OWE it to them to correctly explain how the editor works so they do not get hung up on it.
This book really sucks, I want my money back.
|