Ticket #1796 (reopened enhancement)

Opened 1 year ago

Last modified 9 months ago

sorted() requires Python2.4

Reported by: yattom Assigned to: yattom
Priority: normal Component: NikoCaleMacro
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

use list.sort()

Attachments

Change History

07/15/07 17:49:43 changed by yattom

  • status changed from new to closed.
  • resolution set to fixed.

(In [2476]) sorted() -> list.sort() fixed #1796

07/15/07 18:48:51 changed by coderanger

For future reference:

from trac.util.compat import sorted

04/21/08 21:41:35 changed by laughsmile

  • status changed from closed to reopened.
  • resolution deleted.

I think there's still a bug exists in dates.sort().

my dates array's values before sorted : 4/23,4/21,4/22,4/27,4/26,4/19,4/20,4/24,4/25

after dates.sort() is executed,the array's values turned into: 4/23,4/24,4/25,4/26,4/27,4/19,4/20,4/21,4/22

so after I make the following change: dates.sort() -> dates.sort(lambda x,y: cmp((x.month*100+x.day), (y.month*100+y.day)))

It work well for me


Add/Change #1796 (sorted() requires Python2.4)




Change Properties
Action