[Python-3000] suggestion: structured assignment (original) (raw)
allyourcode at gmail.com allyourcode at gmail.com
Thu May 29 06:34:14 CEST 2008
- Previous message: [Python-3000] suggestion: structured assignment
- Next message: [Python-3000] suggestion: structured assignment
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Well, I'm sorry for bothering his majesty with such a stupid idea. At least one other person didn't know about it either...
On 5/28/08, Mike Klaas <mike.klaas at gmail.com> wrote:
On 28-May-08, at 6:23 PM, Daniel Wong wrote:
Currently, I must do the following instead:
for n, pair in enumerate(listofpairs): a, b = pair ... <> Thoughts? I find it hard to believe that you have even attempted this, which has been valid in python for ages: >>> for x, (a, b) in enumerate([(1,2), (3,4), (5,6)]): print x, a, b 0 1 2 1 3 4 2 5 6 -Mike
- Previous message: [Python-3000] suggestion: structured assignment
- Next message: [Python-3000] suggestion: structured assignment
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]