On Thu, May 14, 2009 at 11:10:53AM -0700, Jabin Jezreel wrote:
> > Why not just write is simply as (1, 2, 3) instead of
> > the confusing (1, *(2, 3))?
> 
> It is a contrived example.  In practice it would be
> something more like:
> 
> >>> def ts(*t):
> ...     return t
> ...
> >>> x = (2, 3)
> >>> y = (1, *x)
>   File "<stdin>", line 1
> SyntaxError: can use starred expression only as assignment target
> >>> y = ts(1, *x)
> >>> y
> (1, 2, 3)

But you can already do that without needing to extend * notation
to work like that, so in the Pythonic spirit of there only being
one obvious/best/clear way to do something... 

y = (1,) + x

why does that operation have to be constructed as
y = (1, *x)?


        
> 
> 
> > Don't say that (2, 3) might be a variable, it
> > won't work without breaking python object model.
> > If such construct creates a new tuple, it would
> > need to break python's object model [...]
> 
> Break how?
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor

-- 
Steve Willoughby    |  Using billion-dollar satellites
st...@alchemy.com   |  to hunt for Tupperware.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to