[portland] Clue Stick Needed

Rich Shepard rshepard at appl-ecosys.com
Thu Jan 17 01:31:22 CET 2008

On Wed, 16 Jan 2008, jason kirtland wrote:

> It's here:
> >  	proper = lambda t: (t[3],t[2], t[1], t[0], t[5])
> >          sorted(self.appData.tsets, key=proper)
> >  	for i in range(len(self.appData.tsets)):
> sorted() is sorting a copy of the tsets and discarding the result.  Either:
>    self.appData.tsets.sort(key=proper)
> if tsets is a list and you don't mind modifying in-place, or, better:


   A-ha! I didn't catch that. I don't mind sorting the list in place. And,
I'll use a different loop index in the second 'for' loop.



Richard B. Shepard, Ph.D.               |  Integrity            Credibility
Applied Ecosystem Services, Inc.        |            Innovation
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863

More information about the Portland mailing list