Re: ZTK 2.0: Deprecate zope.sequencesort

Wichert Akkerman <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
On Mar 1, 2013, at 19:06, "Suresh V." <[email protected]> wrote:

> On Friday 01 March 2013 02:15 PM, Lennart Regebro wrote:
>> I'm sorry, it's early in the morning. It is of course:
>> 
>>>      sorted(sorted(news_stories, key=lambda x: x.publication_date,
>>>                reverse=True), key=lambda x: x.category)
>> 
> 
> Won't the two sorteds step over each other?

No: since Python 2.2 sorting is guaranteed to be stable. See http://wiki.python.org/moin/HowTo/Sorting/#Sort_Stability_and_Complex_Sorts for more information.

Wichert.
_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.