one-element tuples [Was: Most probably a stupid question, but I still want to ask]

Stephen Hansen me+python at ixokai.io
Sun Apr 10 20:28:39 EDT 2016


On Sun, Apr 10, 2016, at 05:22 PM, Fillmore wrote:
> Hold on a sec! it turns up that there is such thing as single-element
> tuples in python:
> 
>  >>> c = ('hello',)
>  >>> c
> ('hello',)
>  >>> c[0]
> 'hello'
>  >>> c[1]
> Traceback (most recent call last):
>    File "<stdin>", line 1, in <module>
> IndexError: tuple index out of range
>  >>>
> 
> So, my original question makes sense. Why was a discontinuation point
> introduced by the language designer?

What discontinuation point? 

You keep masterfully managing to *not explain what you're asking*. What
is surprising to you? 

--S



More information about the Python-list mailing list