This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jsizelove
Recipients georg.brandl, jsizelove
Date 2008-08-05.01:50:59
SpamBayes Score 3.1775336e-08
Marked as misclassified No
Message-id <1217901064.2.0.318710120877.issue3503@psf.upfronthosting.co.za>
In-reply-to
Content
I decided to learn more about the coming changes in Python 3.0 by
installing the beta and working through the tutorial.  I found some
discrepancies between the code examples and the output I got.  The
attached patch shows several places where the print() function is called
incorrectly.  These are mostly examples that are missing the parentheses.

The rest of this comment pertains to only one change included in the
patch that I find less than satisfactory.  In introduction.html, there
is an example of printing a fibonacci sequence in one line of output by
using the end keyword.  When actually run in the python interpreter, the
>>> prompt shows at the end of the same line as the fibonacci numbers. 
The patch fixes this by enclosing a "print()" within an else clause.

This "fix" produces the expected output, but I don't think the else
clause has been described yet in the tutorial.  A better fix would be to
wrap the while statement in a function with a print() function call
after the end of the while statement (this is how the fib() function is
defined in http://docs.python.org/dev/3.0/tutorial/modules.html).  But
functions have not been explained this early in the tutorial.

Perhaps it would be best to drop this example of using the end keyword
to the print function in the introduction and explain it later in the
tutorial.
History
Date User Action Args
2008-08-05 01:51:04jsizelovesetrecipients: + jsizelove, georg.brandl
2008-08-05 01:51:04jsizelovesetmessageid: <1217901064.2.0.318710120877.issue3503@psf.upfronthosting.co.za>
2008-08-05 01:51:03jsizelovelinkissue3503 messages
2008-08-05 01:51:01jsizelovecreate