Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #95649 > unrolled thread

Re: [a,b,c,d] = 1,2,3,4

Started byChris Angelico <rosuav@gmail.com>
First post2015-08-26 23:04 +1000
Last post2015-08-26 23:04 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [a,b,c,d] = 1,2,3,4 Chris Angelico <rosuav@gmail.com> - 2015-08-26 23:04 +1000

#95649 — Re: [a,b,c,d] = 1,2,3,4

FromChris Angelico <rosuav@gmail.com>
Date2015-08-26 23:04 +1000
SubjectRe: [a,b,c,d] = 1,2,3,4
Message-ID<mailman.43.1440594254.11709.python-list@python.org>
On Wed, Aug 26, 2015 at 12:59 AM, Jean-Michel Pichavant
<jeanmichel@sequans.com> wrote:
> To add to Joel's answer, the right side can be *any* sequence, and is not restricted to lists or tuples.
>
> a, b, c = (x for x in range(3)) # a generator for instance

FWIW, a generator is not a sequence; this works because the right side
can be any *iterable*, even more general than sequences.

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web