Andre Engels wrote:
2009/12/4 Петров Александр :
Hello All !
In my code I try to use a generic approach to work with tuples. Let
"X" be a tuple.
When I want to access a first element of a tuple, I can write: "X[0]".
And that is really working when X is a n-arity tuple, with n>1 (for
example "fo
By adding a before the closing brace of the tucomma after 1. Python allow
this to disambiguate between braced expression and tuple
>>> type( (1,) )
2009/12/4 Петров Александр
>
> How could I tell Python that "(1)" is not an integer, but an one-arity
> tuple ?
>
> Thank you,
> Alexander Petrov
On Fri, Dec 04, 2009 at 15:17 +0300, Петров Александр wrote:
> In my code I try to use a generic approach to work with tuples. Let
> "X" be a tuple.
> When I want to access a first element of a tuple, I can write: "X[0]".
> And that is really working when X is a n-arity tuple, with n>1 (for
> examp
By adding a before the closing brace of the tuple. Python allow this to
disambiguate between braced expression and tuple
>>> type( (1,) )
2009/12/4 Петров Александр
>
> How could I tell Python that "(1)" is not an integer, but an one-arity
> tuple ?
>
> Thank you,
> Alexander Petrov
> --
> ht
2009/12/4 Петров Александр :
> Hello All !
>
> In my code I try to use a generic approach to work with tuples. Let
> "X" be a tuple.
> When I want to access a first element of a tuple, I can write: "X[0]".
> And that is really working when X is a n-arity tuple, with n>1 (for
> example "foo( (1,2,3)
Hello All !
In my code I try to use a generic approach to work with tuples. Let
"X" be a tuple.
When I want to access a first element of a tuple, I can write: "X[0]".
And that is really working when X is a n-arity tuple, with n>1 (for
example "foo( (1,2,3) )" ).
But when I call my library function