Python can't divide??!?!

Kurt B. Kaiser kbk at shore.net
Sat Feb 7 18:42:18 CET 2004


John Hunter <jdhunter at ace.bsd.uchicago.edu> writes:

> The thing that may be tripping you up is that (val) is simply the
> value, and (val,) is a tuple containing the value as the first
> element.  As for printing a value versus a tuple of values, that's the
> __repr__ versus __str__ distinction previous posters have referred to.

:-)

Tim enlightened me on this issue some years ago, when I suggested a
"solution" using sys.displayhook;

http://www.google.com/groups?q=g:thl2117804141d&dq=&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=mailman.991854611.2080.python-list%40python.org

Just try explaining this stuff to a 9 year old learning Python!  It
tends to break the expository flow....

-- 
KBK

"Don't sit there with your face all screwed up. Swallow!
 Cod liver oil is good for you"



More information about the Python-list mailing list