Wrox Programmer Forums
|
BOOK: Beginning Python: Using Python 2.6 and Python 3.1
This is the forum to discuss the Wrox book Beginning Python: Using Python 2.6 and Python 3.1 by James Payne; ISBN: 978-0-470-41463-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Python: Using Python 2.6 and Python 3.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 3rd, 2011, 08:14 PM
Registered User
 
Join Date: Oct 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.
 
Old October 6th, 2011, 01:59 PM
Registered User
 
Join Date: Oct 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Oops - found my mistake

Somehow missed the authors note that there are two underscores preceding doc.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Working through Chapter 1 Geoffrey Chambers BOOK: Beginning SharePoint 2007: Building Team Solutions with MOSS 2007 ISBN: 978-0-470-12449-9 1 January 2nd, 2010 11:38 PM
Chapter 4 - Two Views, not working for me... bigtalk BOOK: Beginning Ruby on Rails 1 January 3rd, 2008 07:30 AM
Chapter 1: Greeting Not Working Joe3000 BOOK: Beginning Ruby on Rails 2 June 14th, 2007 10:54 AM
Chapter 1, First App, No, it's not working redthor BOOK: Beginning Ruby on Rails 2 February 1st, 2007 08:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.