[New-bugs-announce] [issue4144] 3 tutorial documentation errors

David W. Lambert report at bugs.python.org
Sat Oct 18 22:35:34 CEST 2008

New submission from David W. Lambert <lambertdw at corning.com>:

I ran doctests on the interactive session scripts from the tutorial.
Aside from finding a doctest enhancement---but there are already so 
many doctest issues tracked---I found these discrepancies using online 
tutorial and Python 3.0rc1 (r30rc1:66499, Oct 17 2008, 13:11:34)

"doesn't" --> "does not"   Trite documentation error


Time to fix the doctest EXCEPTION_DETAIL

TypeError: 'str' object doesn't support ... (multiple occurrences)

"doesn't"  became  "does not"  in release 2.4.

"coercing to Unicode" or "convert to str"?

$ p3
Python 3.0rc1 (r30rc1:66499, Oct 17 2008, 13:11:34) 
[GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> '2'+3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Can't convert 'int' object to str implicitly

>>> '2' + 2
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: coercing to Unicode: need string or buffer, int found

Integer division yields float


>>> divide(2, 1)    # 2.0 is correct
result is 2

doctest improvement possible

# execute this as sh code to exhibit problem
    example from

    >>> 'doesn\'t'

import doctest
python p.py
# "\"Yes,\" he said." # likewise breaks doctest
# end of sh scripting

I suppose these issues are known.  Here's another that fails in 

>>> re.findall(r'\bf[a-z]*', 'which foot or hand fell fastest')
['foot', 'fell', 'fastest']

messages: 74958
nosy: LambertDW
severity: normal
status: open
title: 3 tutorial documentation errors
versions: Python 3.0

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list