[issue4545] doctest seems to always fail on numpy.array2string
Amaury Forgeot d'Arc
report at bugs.python.org
Fri Dec 5 14:24:01 CET 2008
Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:
Doctest output scrupulously follows the output of an interactive session
of python.
On my machine:
Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.array2string(numpy.arange(2))
'[0 1]'
>>>
The the interactive session does not simply print objects, it calls
repr() on them, so that you can make the distinction between the number
0 and the string "0".
You should add quotes to your doctest string, or use print:
>>> import numpy
>>> print numpy.array2string(numpy.arange(2))
[0 1]
----------
nosy: +amaury.forgeotdarc
resolution: -> invalid
status: open -> closed
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4545>
_______________________________________
More information about the Python-bugs-list
mailing list