[Tutor] (no subject)

Ben Beuchler insyte@emt-p.org
Fri, 1 Sep 2000 10:32:07 -0500


On Sat, Sep 02, 2000 at 06:41:29PM +0800, deng wei wrote:

> Hi,all:
>    There is a mistake in the Python Manuals at "5.3 Tuples and Sequences".It said:
> 	a tuple with one item is constructed by following a value with a comma (it is not sufficient to enclose a single value in parentheses).  
>    
> 
>    but if you type:
> >>> b=('hello')
> >>> b
> 'hello'
>    
>   No problem!?
>   
>   Am I right?

Nope.

>>> b=('hello')
>>> type(b)
<type 'string'>
>>> 
>>> b=('hello',)
>>> type(b)
<type 'tuple'>

Ben

-- 
Ben Beuchler                                         insyte@bitstream.net
MAILER-DAEMON                                         (612) 321-9290 x101
Bitstream Underground                                   www.bitstream.net