In article 
<da776a8c0911290142o8ddce42n4825188bc5e23...@mail.gmail.com>,
 inhahe <inh...@gmail.com> wrote:
> maybe that thing in python 3 that someone mentioned is the answer, but
> otherwise i always think Python should admit something like this:
> 
> a, b, c, *d = list
> 
> i.e. if list were [1,2,3,4,5], you'd get a=1, b=2, c=3, d=[4, 5]

Extended iterable unpacking (http://www.python.org/dev/peps/pep-3132/) 
is implemented in python 3.

$ python3
Python 3.1.1 (r311:74543, Aug 24 2009, 18:44:04) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a, b, c, *d = [1,2,3,4,5]
>>> d
[4, 5]

-- 
 Ned Deily,
 n...@acm.org

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to