Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Open Source > BOOK: Beginning Python: Using Python 2.6 and Python 3.1
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 3rd, 2011, 09:14 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
Reply With Quote
  #2 (permalink)  
Old October 6th, 2011, 02:59 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 11:54 AM
Chapter 1, First App, No, it's not working redthor BOOK: Beginning Ruby on Rails 2 February 1st, 2007 08:32 PM



All times are GMT -4. The time now is 08:53 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.