[issue6903] pdb - print in for iteration prints None after printing

Mitchell Model report at bugs.python.org
Mon Sep 14 02:18:25 CEST 2009


New submission from Mitchell Model <mlm at acm.org>:

Near the bottom of the library documentation for pdb there is an example
of a very useful alias:

alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k])

It turns out that doing print in a for loop in pdb results in None being
printed on a line after each print. For example:

(Pdb) 
for n in range(3): print(n)
0
None
1
None
2
None
(Pdb) 

Seems like a (minor) bug, but if not, the example should be removed or
replaced in the documentation.

----------
assignee: georg.brandl
components: Documentation, Library (Lib)
messages: 92588
nosy: MLModel, georg.brandl
severity: normal
status: open
title: pdb - print in for iteration prints None after printing
versions: Python 3.0, Python 3.1, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6903>
_______________________________________


More information about the Python-bugs-list mailing list