
Oct. 22, 2011
9:43 p.m.
On 22 October 2011 22:33, Antoine Pitrou <solipsis@pitrou.net> wrote:
On Sat, 22 Oct 2011 18:32:25 +1100 Steven D'Aprano <steve@pearwood.info> wrote:
Remember also that print(spam) will use str(spam). If you do this:
>>> print(spam) something
what would you expect spam is?
What if:
print(spam) 1
It might be the integer 1 or the string "1". You need repr() to tell the difference.
Indeed:
print(A) <class '__main__.A'> A "<class '__main__.A'>"
-- Arnaud