docstring described in Chapter 5 not working
I have installed Python 3.2 and the book is specifically titled for Python 2.6 and 3.1, so maybe the newer version doesn't support docstrings. Here is the error message I get when I invoke the print statement at the top of page 76:
>>> print("%s" % in_fridge._doc_)
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
print("%s" % in_fridge._doc_)
AttributeError: 'function' object has no attribute '_doc_'
>>>
Another unexpected behavior is that the triple quoted docstring in in_fridge() has to be indented or a get a syntax error window with the message
"expected an indented block"
As long as I indent the triple quoted string, the module runs. So far, Nothing I've tried will make the docstring feature work.
|