python list pattern matching?

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Thu May 28 20:30:20 EDT 2009


On Thu, 28 May 2009 18:57:42 -0400, Terry Reedy wrote:

>  >>> a,b,*rest = list(range(10))

That fails in Python 2.5 and 2.6.

>>> a,b,*rest = list(range(10))
  File "<stdin>", line 1
    a,b,*rest = list(range(10))
        ^
SyntaxError: invalid syntax




-- 
Steven



More information about the Python-list mailing list