[Python-checkins] python/dist/src/Doc/tut tut.tex,1.180,1.181

Thomas Wouters thomas@xs4all.net
Wed, 7 May 2003 17:45:06 +0200


On Wed, May 07, 2003 at 08:29:14AM -0700, montanaro@users.sourceforge.net wrote:

> ! >>> # The argument to repr() may be any Python object:
> ! ... repr(x, y, ('spam', 'eggs'))
> ! "(32.5, 40000, ('spam', 'eggs'))"

Close, but no cigar:

>>> repr(x, y, ('spam', 'eggs')) 
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: repr() takes exactly one argument (3 given)

>>> repr((x, y, ('spam', 'eggs')))
"(32.5, 40000, ('spam', 'eggs'))"

This is what Fred meant in his 'it needs an additional set of parentheses'
comment to the patch.

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!