Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #85262
| References | (4 earlier) <CAPTjJmp=b2ZA8eqvyf3tqK+0MHqOgS-PAG+ELNNOwuKKPq4FJQ@mail.gmail.com> <mailman.18488.1423127457.18130.python-list@python.org> <54d33aa6$0$13003$c3e8da3$5496439d@news.astraweb.com> <mailman.18491.1423152554.18130.python-list@python.org> <6304fe65-0606-40eb-8732-c9ba9ae168e7@googlegroups.com> |
|---|---|
| Date | 2015-02-05 10:56 -0600 |
| Subject | Re: meaning of: line, = |
| From | Skip Montanaro <skip.montanaro@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.18493.1423155421.18130.python-list@python.org> (permalink) |
Tuple packing. No longer supported in Python 3, but in available in Python <= 2. Skip On Thu, Feb 5, 2015 at 10:45 AM, Rustom Mody <rustompmody@gmail.com> wrote: > On Thursday, February 5, 2015 at 9:39:27 PM UTC+5:30, Ian wrote: >> On Thu, Feb 5, 2015 at 2:40 AM, Steven D'Aprano wrote: >> > Devin Jeanpierre wrote: >> > >> >> On Wed, Feb 4, 2015 at 1:18 PM, Chris Angelico wrote: >> >>> On Thu, Feb 5, 2015 at 4:36 AM, Peter Otten wrote: >> >>>> Another alternative is to put a list literal on the lefthand side: >> >>>> >> >>>>>>> def f(): yield 42 >> >>>> >> >>>> ... >> >>>>>>> [result] = f() >> >>>>>>> result >> >>>> 42 >> >>> >> >>> Huh, was not aware of that alternate syntax. >> >> >> >> Nor are most people. Nor is Python, in some places -- it seems like >> >> people forgot about it when writing some bits of the grammar. >> > >> > Got an example where you can use a,b but not [a,b] or (a,b)? >> >> >>> def f(a, (b, c)): >> ... print a, b, c > > What the hell is that?! > First I am hearing/seeing it. > Whats it called? > -- > https://mail.python.org/mailman/listinfo/python-list
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: meaning of: line, = Albert-Jan Roskam <fomcl@yahoo.com> - 2015-02-04 14:38 +0000
Re: meaning of: line, = Rustom Mody <rustompmody@gmail.com> - 2015-02-04 07:09 -0800
Re: meaning of: line, = Peter Otten <__peter__@web.de> - 2015-02-04 18:36 +0100
Re: meaning of: line, = Chris Angelico <rosuav@gmail.com> - 2015-02-05 08:18 +1100
Re: meaning of: line, = Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-02-05 01:10 -0800
Re: meaning of: line, = Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-05 20:40 +1100
Re: meaning of: line, = Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-05 09:08 -0700
Re: meaning of: line, = Rustom Mody <rustompmody@gmail.com> - 2015-02-05 08:45 -0800
Re: meaning of: line, = Skip Montanaro <skip.montanaro@gmail.com> - 2015-02-05 10:56 -0600
Re: meaning of: line, = Tim Chase <python.list@tim.thechases.com> - 2015-02-05 11:00 -0600
Re: meaning of: line, = Rustom Mody <rustompmody@gmail.com> - 2015-02-05 08:59 -0800
Re: meaning of: line, = Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-02-06 05:09 -0800
Re: meaning of: line, = Rustom Mody <rustompmody@gmail.com> - 2015-02-06 05:20 -0800
Re: meaning of: line, = Rustom Mody <rustompmody@gmail.com> - 2015-02-06 06:03 -0800
Re: meaning of: line, = Tim Chase <python.list@tim.thechases.com> - 2015-02-05 10:21 -0600
Re: meaning of: line, = Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-02-05 17:12 -0800
Re: meaning of: line, = Chris Angelico <rosuav@gmail.com> - 2015-02-06 12:17 +1100
Re: meaning of: line, = Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-02-06 17:52 +1300
Re: meaning of: line, = Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-02-06 12:30 +1300
csiph-web