On Fri, 23 Feb 2007 13:45:54 -0800 (PST)
Terry Carroll <[EMAIL PROTECTED]> wrote:
> > Any other way to create an empty tuple?
>
> Answering my own question:
>
> >>> t=()
> >>> type(t)
>
Giving the lie to my earlier summary (that tuples are
indicated by commas only -- arrgh :)
__
Terry Carroll wrote:
> On Fri, 23 Feb 2007, Luke Paireepinart wrote:
>
>
>> That's because you can't make tuples of single values.
>> Think of it like this:
>> a TUple needs TWO elements or more.
>>
>
> No, a tuple can also be of one element, or even none. You can create a
> single-element
On Fri, 23 Feb 2007, Terry Carroll wrote:
> You can also create an empty tuple, but I think only through the tuple()
> method:
> >>> t=tuple()
>
> Any other way to create an empty tuple?
Answering my own question:
>>> t=()
>>> type(t)
___
Tutor m
On Fri, 23 Feb 2007, Bill Sconce wrote:
> It's not true that
>parentheses indicate tuples
> (They don't. Not unless there are "commas in there".)
Except in one case, the empty tuple:
t = ()
___
Tutor maillist - Tutor@python.org
http://mail.pyt
On Fri, 23 Feb 2007, Luke Paireepinart wrote:
> That's because you can't make tuples of single values.
> Think of it like this:
> a TUple needs TWO elements or more.
No, a tuple can also be of one element, or even none. You can create a
single-element tuple either directly through the use of a t
Tim Golden wrote:
> Luke Paireepinart wrote:
>
>> That's because you can't make tuples of single values.
>> Parenthesis are ways of controlling order of operation.
>> They don't create tuples unless there's more than one value.
>
>> Think of it like this:
>> a TUple needs TWO elements or more.
>> S
Don't feel bad. Everyone who works with Python bumps into this.
And more than once...
The preceding reply is correct. But perhaps this is more specific:
> TYPES_PYTHON_TO_XML = {
>'int':('xs:hexbinary','xs:integer'),
>'str':("xs:string")
>}
The problem is h
Luke Paireepinart wrote:
> That's because you can't make tuples of single values.
> Parenthesis are ways of controlling order of operation.
> They don't create tuples unless there's more than one value.
> Think of it like this:
> a TUple needs TWO elements or more.
> Solution:
> use lists. They
Adam Pridgen wrote:
> Hello,
>
> When I have a tuple with a single string in a dictionary entry and
> try to iterate over the tuple and it breaks the string into individual
> characters. Is this supposed to be happening?
>
> This problem is a little tricky to explain so I have included the
> outpu
Hello,
When I have a tuple with a single string in a dictionary entry and
try to iterate over the tuple and it breaks the string into individual
characters. Is this supposed to be happening?
This problem is a little tricky to explain so I have included the
output and the corresponding example c
10 matches
Mail list logo