Author r.david.murray
Recipients r.david.murray
Date 2013-08-16.23:16:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1376694990.04.0.946395407142.issue18764@psf.upfronthosting.co.za>
In-reply-to
Content
In 2.7:

>>> import pdb
>>> from email import message_from_string as m
>>> x = m("To: me\nfrom: you\n\ntest\n")
>>> pdb.set_trace()
--Return--
> <stdin>(1)<module>()->None
(Pdb) print x
From nobody Fri Aug 16 19:06:58 2013
To: me
from: you

test


In 3.4:

>>> import pdb
>>> from email import message_from_string as m
>>> x = m("To: me\nfrom: you\n\ntest\n")
>>> pdb.set_trace()
--Return--
> <stdin>(1)<module>()->None
(Pdb) print x
<email.message.Message object at 0xb707b92c>


Since the print command masks the print function, it is difficult (though
not impossible) to actually get the print representation of something:

(Pdb) print(str(x))
'To: me\nfrom: you\n\ntest\n'
(Pdb) not print(x)
To: me
from: you

test

True


Because print is a function rather than a statement in python3, it might be better to just drop the print command from pdb.  Someone working in Python3 is likely to type "print(...)" at the python3 pdb command line and expect it to work like the print function.
History
Date User Action Args
2013-08-16 23:16:30r.david.murraysetrecipients: + r.david.murray
2013-08-16 23:16:30r.david.murraysetmessageid: <1376694990.04.0.946395407142.issue18764@psf.upfronthosting.co.za>
2013-08-16 23:16:29r.david.murraylinkissue18764 messages
2013-08-16 23:16:29r.david.murraycreate