displayhook behavior in pdb
May I have a short vote on this issue: http://bugs.python.org/issue6903 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 1 (Pdb) bar (Pdb) (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? cheers, Georg -- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out.
Georg Brandl wrote:
May I have a short vote on this issue:
http://bugs.python.org/issue6903
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 1 (Pdb) bar (Pdb)
(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. Michael
cheers, Georg
2009/9/16 Michael Foord <fuzzyman@voidspace.org.uk>:
Georg Brandl wrote:
May I have a short vote on this issue:
http://bugs.python.org/issue6903
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 1 (Pdb) bar (Pdb)
(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.
I agree (although I don't use pdb, so my view shouldn't be given too much weight...) Paul.
On Wed, Sep 16, 2009 at 3:48 AM, Paul Moore <p.f.moore@gmail.com> wrote:
2009/9/16 Michael Foord <fuzzyman@voidspace.org.uk>:
Georg Brandl wrote:
May I have a short vote on this issue:
http://bugs.python.org/issue6903
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 1 (Pdb) bar (Pdb)
(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.
I agree (although I don't use pdb, so my view shouldn't be given too much weight...)
I *do* use pdb a lot, and I agree that the new behavior is weird. -- --Guido van Rossum (home page: http://www.python.org/~guido/)
Guido van Rossum schrieb:
>> Now, what is the lesser evil? >> >> > > IMO not showing the extraneous Nones is preferable.
I agree (although I don't use pdb, so my view shouldn't be given too much weight...)
I *do* use pdb a lot, and I agree that the new behavior is weird.
Okay, I've fixed it in trunk and will backport soon. Georg -- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out.
participants (4)
-
Georg Brandl
-
Guido van Rossum
-
Michael Foord
-
Paul Moore