[Python-Dev] displayhook behavior in pdb
fuzzyman at voidspace.org.uk
Wed Sep 16 12:08:01 CEST 2009
Georg Brandl wrote:
> May I have a short vote on this issue:
> In short, pdb (since 2.6) uses a separate displayhook in order to avoid
> _ being reassigned (which screws up debugging apps that use _ as gettext).
> In that displayhook, I did not add the suppression of printing None, as
> it can be confusing to look at variables and get no output:
> (Pdb) foo
> (Pdb) bar
> (You could argue that this is what the "p" command is for though.)
> Now in Python 3, where print is a function, if you call print in a loop
> (e.g. to debug a list or dictionary, as it is advertised in the pdb docs
> under the "alias" command), the output has the printed values interspersed
> with "None"s.
> Now, what is the lesser evil?
IMO not showing the extraneous Nones is preferable.
More information about the Python-Dev