Guido van Rossum wrote: > I personally think this is adequately handled by writing: > > (first, second), rest = something[:2], something[2:]
That's less than satisfying because it violates DRY three times (once for mentioning 'something' twice, once for mentioning the index twice, and once for needing to make sure the index agrees with the number of items on the LHS). > Argument lists are not tuples [*] and features of argument lists > should not be confused with features of tuple unpackings. I'm aware of the differences, but I still see a strong similarity where this particular feature is concerned. The pattern of thinking is the same: "I want to deal with the first n of these things individually, and the rest collectively." -- Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | [EMAIL PROTECTED] +--------------------------------------+ _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com