classification
Title: Simple mistake in http://docs.python.org/tut/node6.html
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: dmazz, georg.brandl, loewis (3)
Priority: Keywords:

Created on 2007-10-30 00:56 by dmazz, last changed 2007-10-30 17:58 by georg.brandl.

Messages (4)
msg56948 - (view) Author: Dan M (dmazz) Date: 2007-10-30 00:56
In section 4.6 it says:
Writing the value None is normally suppressed by the interpreter if it
would be the only value written.

When it should say:
Writing the value None is normally displayed by the interpreter if it
would be the only value written.

Or less wordy:
The value None is (normally) displayed by the interpreter when it would
be the only value written.
msg56956 - (view) Author: Martin v. Löwis (loewis) Date: 2007-10-30 06:21
I fail to see the bug. The documentation is correct as it stands, ie.
None is *not* displayed normally. IOW, writing is normally suppressed.
msg56961 - (view) Author: Dan M (dmazz) Date: 2007-10-30 13:07
Yes, it is normally suppressed.  The problem is the condition when it is
suppressed.  The documentation states that it's suppressed when it's the
only value to be written.

It is suppressed when it's *not* the only value to be written. 
-or- (removing the double negative of suppressed(not displayed) and not)
It is displayed when it would be the only value written.

The example immediately following this mistake is correct, which makes
the actual behavior obvious even if this particular statement is wrong.
msg56968 - (view) Author: Georg Brandl (georg.brandl) Date: 2007-10-30 17:58
No, the text is correct, but the example is misleading -- I now changed
it to

>>> fib(0)
>>> print fib(0)
None

which should make the difference between using and not using print clearer.
History
Date User Action Args
2007-10-30 17:58:14georg.brandlsetnosy: + georg.brandl
messages: + msg56968
2007-10-30 13:07:17dmazzsetmessages: + msg56961
2007-10-30 06:21:09loewissetstatus: open -> closed
resolution: invalid
messages: + msg56956
nosy: + loewis
2007-10-30 00:56:54dmazzcreate