Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-03-04 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/03/2013 10:34 PM, Arfrever Frehtes Taifersar Arahesis wrote: > 2013-02-28 21:04:33 Tres Seaver napisa?(a): >> I have ported it to Python 3.2 and 3.3 and released a 4.0.0 >> version. > > There are still multiple problems (types.TupleType, > sys.m

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-03-03 Thread Arfrever Frehtes Taifersar Arahesis
2013-02-28 21:04:33 Tres Seaver napisał(a): > I have ported it to Python 3.2 and 3.3 and released a 4.0.0 version. There are still multiple problems (types.TupleType, sys.modules.has_key etc.): $ PYTHONPATH="src" python3.3 -c "import zope.sequencesort" Traceback (most recent call last): File ""

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-03-01 Thread Martijn Pieters
On Thursday, February 28, 2013, Stephan Richter wrote: > I would like to deprecate zope.sequencesort in ZTK 2.0, since it cannot > properly ported to Python 3, since it depends heavily on the cmp() way of > sorting. I am also not a user of the package and I only tried to port the > package for com

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-03-01 Thread Lennart Regebro
On Fri, Mar 1, 2013 at 7:06 PM, Suresh V. 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.cat

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-03-01 Thread Charlie Clark
Hi Tres, Am 28.02.2013, 21:04 Uhr, schrieb Tres Seaver : The main export of the package is the 'sort' function, which takes a sequence, per-column sort specs (key/attr name, sort function, direction), and optional extra data (e.g., the DTML namespace) and a flag indicating whether to use key or

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-03-01 Thread Wichert Akkerman
On Mar 1, 2013, at 19:06, "Suresh V." 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)

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-03-01 Thread Arfrever Frehtes Taifersar Arahesis
2013-03-01 04:04:07 Tres Seaver napisał(a): > On 02/28/2013 10:00 PM, Lennart Regebro wrote: > > On Thu, Feb 28, 2013 at 5:33 PM, Tres Seaver > > wrote: > >> -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > >> > >> On 02/28/2013 10:41 AM, Lennart Regebro wrote: > >> > >>> Reading through the code,

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-03-01 Thread Suresh V.
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? Suresh

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-03-01 Thread Lennart Regebro
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) I forgot the "key=" bit. ___ Zope-Dev maillist - Zope-Dev@zope.org ht

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-03-01 Thread Lennart Regebro
On Fri, Mar 1, 2013 at 4:04 AM, Tres Seaver wrote: > Assuming an unsorted list of news stories, how would you use sorted to > get them ordered by category (ascending) + publication date (descending)? This is the easiest, most obvious way: sorted(sorted(news_stories, lambda x: x.publication_

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-02-28 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/28/2013 10:00 PM, Lennart Regebro wrote: > On Thu, Feb 28, 2013 at 5:33 PM, Tres Seaver > wrote: >> -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 >> >> On 02/28/2013 10:41 AM, Lennart Regebro wrote: >> >>> Reading through the code, it seems t

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-02-28 Thread Lennart Regebro
On Thu, Feb 28, 2013 at 5:33 PM, Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 02/28/2013 10:41 AM, Lennart Regebro wrote: > >> Reading through the code, it seems to use a lot of code to provide >> quite basic sorting functionality. It feels like it's trying to fill >

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-02-28 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/28/2013 01:04 PM, Stephan Richter wrote: > On Thursday, February 28, 2013 11:32:26 AM Tres Seaver wrote: >>> Thoughts? >> >> I'm generally in favor of shrinking the ZTK, but just for >> discussion's sake: emulating 'cmp' for objects which have

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-02-28 Thread Stephan Richter
On Thursday, February 28, 2013 11:32:26 AM Tres Seaver wrote: > > Thoughts? > > I'm generally in favor of shrinking the ZTK, but just for discussion's > sake: emulating 'cmp' for objects which have rich comparison semantics > isn't that difficult:: > > def _faux_cmp(lhs, rhs): > return i

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-02-28 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/28/2013 10:41 AM, Lennart Regebro wrote: > Reading through the code, it seems to use a lot of code to provide > quite basic sorting functionality. It feels like it's trying to fill > the same role as sorted() does since Python 2.4. The other

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-02-28 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/28/2013 08:43 AM, Stephan Richter wrote: > Hi everyone, > > I would like to deprecate zope.sequencesort in ZTK 2.0, since it > cannot properly ported to Python 3, since it depends heavily on the > cmp() way of sorting. I am also not a user of th

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-02-28 Thread Lennart Regebro
On Thu, Feb 28, 2013 at 3:00 PM, Wichert Akkerman wrote: > > On Feb 28, 2013, at 14:43 , Stephan Richter wrote: > >> Hi everyone, >> >> I would like to deprecate zope.sequencesort in ZTK 2.0, since it cannot >> properly ported to Python 3, since it depends heavily on the cmp() way of >> sorting.

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-02-28 Thread Stephan Richter
On Thursday, February 28, 2013 02:59:33 PM Hanno Schlichting wrote: > In the same way, I think we should remove RestrictedPython and > zope.untrustedpython from the ZTK. Since those are also very much > dependencies of Zope alone and porting is going to be a very > challenging task. Well, it is us

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-02-28 Thread Wichert Akkerman
On Feb 28, 2013, at 14:43 , Stephan Richter wrote: > Hi everyone, > > I would like to deprecate zope.sequencesort in ZTK 2.0, since it cannot > properly ported to Python 3, since it depends heavily on the cmp() way of > sorting. I am also not a user of the package and I only tried to port the

Re: [Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-02-28 Thread Hanno Schlichting
On Thu, Feb 28, 2013 at 2:43 PM, Stephan Richter wrote: > I would like to deprecate zope.sequencesort in ZTK 2.0, since it cannot > properly ported to Python 3, since it depends heavily on the cmp() way of > sorting. I am also not a user of the package and I only tried to port the > package for co

[Zope-dev] ZTK 2.0: Deprecate zope.sequencesort

2013-02-28 Thread Stephan Richter
Hi everyone, I would like to deprecate zope.sequencesort in ZTK 2.0, since it cannot properly ported to Python 3, since it depends heavily on the cmp() way of sorting. I am also not a user of the package and I only tried to port the package for completeness sake. Thoughts? Regards, Stephan --