Re: [Zope-dev] case insensitive sorts

2001-01-05 Thread Chris Withers
Shane Hathaway wrote: > > Shane Hathaway wrote: > > def sort_strings(data): > > sortable_data = list(map(lambda s: (lower(s), s), data)) > > sortable_data.sort() > > return map(lambda s: s[1], sortable_data) > > ... Or better, you could pass a comparison function to sort() like Tres > sugg

Re: [Zope-dev] case insensitive sorts

2001-01-04 Thread Dieter Maurer
Chris Withers writes: > Dieter Maurer wrote: > > > > Chris Withers writes: > > > Andrew > > > bart > > > David > > > sophie > > > Wayne > > Why in hell do you switch caseness for similar objects? > > Who said anything about objects? Maybe, I should have said subjects. Your examp

Re: [Zope-dev] case insensitive sorts

2001-01-04 Thread Shane Hathaway
Shane Hathaway wrote: > def sort_strings(data): > sortable_data = list(map(lambda s: (lower(s), s), data)) > sortable_data.sort() > return map(lambda s: s[1], sortable_data) ... Or better, you could pass a comparison function to sort() like Tres suggested. :-) Shane _

Re: [Zope-dev] case insensitive sorts

2001-01-04 Thread Shane Hathaway
Chris Withers wrote: > > Dieter Maurer wrote: > > > > Chris Withers writes: > > > Andrew > > > bart > > > David > > > sophie > > > Wayne > > Why in hell do you switch caseness for similar objects? > > Who said anything about objects? I was just talking about lists of > strings and in genera

RE: [Zope-dev] case insensitive sorts

2001-01-04 Thread Andy Dawkins
> > * collation (which letters belong together) is highly locale >sensitive (e.g., does a-accent-grave sort with a? etc.) > A Fair point. The answer is whatever seems _naturally_ correct from a users point of view. I think the answer is yes. Elephant entropy écrit élan i.e. In the order i

Re: [Zope-dev] case insensitive sorts

2001-01-04 Thread Tres Seaver
Chris Withers <[EMAIL PROTECTED]> wrote: > Andy McKay wrote: > > > > They want information fast and most users expect case insensitive sorts. Its > > simpler and easy. I think having the ignore_case option for a -tree and -in > > helps Zope by increasing the ease of development and friendliness

Re: [Zope-dev] case insensitive sorts

2001-01-04 Thread Chris Withers
Dieter Maurer wrote: > > Chris Withers writes: > > Andrew > > bart > > David > > sophie > > Wayne > Why in hell do you switch caseness for similar objects? Who said anything about objects? I was just talking about lists of strings and in general, people prefer sorting based on the character

Re: [Zope-dev] case insensitive sorts

2001-01-03 Thread Dieter Maurer
Chris Withers writes: > Andrew > bart > David > sophie > Wayne Why in hell do you switch caseness for similar objects? If you apply some naming conventions, such as "objects start with a Capital letter, verb with a lowercase letter", you may find Python's sorting order usefull. Dieter __

Re: [Zope-dev] case insensitive sorts

2001-01-03 Thread Chris Withers
Andy McKay wrote: > > Hmm im actually not so sure on that. Currently you can do a sort either way, > if you fix it so its only case sensitive we'll end up like Visual Basic :) Actually, I'd like to see it 'fixed' so it's only case insensitive: Alan betty Carl Wilbur > Fixing python is a questi

Re: [Zope-dev] case insensitive sorts

2001-01-03 Thread Andy McKay
- Original Message - From: "Chris Withers" <[EMAIL PROTECTED]> To: "Andy McKay" <[EMAIL PROTECTED]> Cc: "Casey Duncan" <[EMAIL PROTECTED]>; "Andy Dawkins" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, January 03,

Re: [Zope-dev] case insensitive sorts

2001-01-03 Thread Chris Withers
Andy McKay wrote: > > They want information fast and most users expect case insensitive sorts. Its > simpler and easy. I think having the ignore_case option for a -tree and -in > helps Zope by increasing the ease of development and friendliness to the > user. And my point was that this is so uni

Re: [Zope-dev] case insensitive sorts

2001-01-03 Thread Andy McKay
ry 03, 2001 8:17 AM Subject: Re: [Zope-dev] case insensitive sorts > Andy Dawkins wrote: > > > > > Your analogies imply that this behavior is a bug or an unintended flaw > > > in the design. I would argue that it is intentional. Unix file systems > > > work

Re: [Zope-dev] case insensitive sorts

2001-01-03 Thread Casey Duncan
Andy Dawkins wrote: > > > Your analogies imply that this behavior is a bug or an unintended flaw > > in the design. I would argue that it is intentional. Unix file systems > > work the same way. Try doing an "ls" with mixed case files and you'll > > see what I mean. > > > > It isn't a flaw. It

RE: [Zope-dev] case insensitive sorts

2001-01-03 Thread Andy Dawkins
> Your analogies imply that this behavior is a bug or an unintended flaw > in the design. I would argue that it is intentional. Unix file systems > work the same way. Try doing an "ls" with mixed case files and you'll > see what I mean. > It isn't a flaw. It seems as though it was overlooked.

Re: [Zope-dev] case insensitive sorts

2001-01-03 Thread Casey Duncan
Andy Dawkins wrote: > > > Dieter Maurer wrote: > > > > > > Chris Withers writes: > > > > Dieter Maurer wrote: > > > > > Andy McKay writes: > > > > > > what does anyone else think > > > > > > > > > > I would not like it. > > > > > > > > Why not? ;-) > > > I would not like to see t

RE: [Zope-dev] case insensitive sorts

2001-01-03 Thread Andy Dawkins
> > Andrew > > David > > Wayne > > bart > > sophie > > > > is better than sorting: > > > > Andrew > > bart > > David > > sophie > > Wayne > > That's only because you use NT (ach spit). ;) > Thats not actually true. It is how python behaves on WinNt, Win9X, Linux, etc (I have tested this) -And

Re: [Zope-dev] case insensitive sorts

2001-01-03 Thread Phil Harris
See below (nothing earth shattering tho) ;) - Original Message - From: "Chris Withers" <[EMAIL PROTECTED]> To: "Shane Hathaway" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, January 03, 2001 10:58 AM Subject: Re: [Zope-dev] case inse

RE: [Zope-dev] case insensitive sorts

2001-01-03 Thread Andy Dawkins
> Dieter Maurer wrote: > > > > Chris Withers writes: > > > Dieter Maurer wrote: > > > > Andy McKay writes: > > > > > what does anyone else think > > > > > > > > I would not like it. > > > > > > Why not? ;-) > > I would not like to see this sort order in the management > > screens,

Re: [Zope-dev] case insensitive sorts

2001-01-03 Thread Chris Withers
Toby Dickenson wrote: > > >(reasons of course would be helpful, particularly if you want it to stay > >like it is ;-) > > I noticed the smiley, so Im not sure how serious the suggestion is. It was serious, the smiley was 'cos I couldn't understand why anyone would want it to stay like it is :-)

Re: [Zope-dev] case insensitive sorts

2001-01-03 Thread Chris Withers
Dieter Maurer wrote: > > Chris Withers writes: > > Dieter Maurer wrote: > > > Andy McKay writes: > > > > what does anyone else think > > > > > > I would not like it. > > > > Why not? ;-) > I would not like to see this sort order in the management > screens, because I use capitali

Re: [Zope-dev] case insensitive sorts

2001-01-03 Thread Chris Withers
Shane Hathaway wrote: > > Python's sort() lets you sort based on not only strings but also tuples, > lists, and numbers, which is a very useful feature. Thus sort() is > intended to be a highly generalized method. It is useful but not ideal > for sorting text strings. What you *really* want is

Re: [Zope-dev] case insensitive sorts

2000-12-08 Thread Steve Alexander
Shane Hathaway wrote: > > BTW have you ever tried this? > > data = [[], (), 0, '', {}] > data.sort() > print data > > The one thing I wonder is whether the sort order is consistent between > different versions of Python. I get: > > [0, {}, [], '', ()] This is consistent across Python

Re: [Zope-dev] case insensitive sorts

2000-12-07 Thread Andy McKay
> 3. ZCatalog stores objects in a pre-sorted order. Changing the sort > order of any object (not just strings) would break *all* existing > ZCatalog instances that store mixed case strings. (and other > applications too - the python language reference documents that this > assmption is safe at le

Re: [Zope-dev] case insensitive sorts

2000-12-07 Thread Andy McKay
uot;Chris Withers" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, December 07, 2000 12:00 PM Subject: Re: [Zope-dev] case insensitive sorts > Chris Withers writes: > > Dieter Maurer wrote: > > > Andy McKay writes: > > > > what does a

Re: [Zope-dev] case insensitive sorts

2000-12-07 Thread Dieter Maurer
Chris Withers writes: > Dieter Maurer wrote: > > Andy McKay writes: > > > what does anyone else think > > > > I would not like it. > > Why not? ;-) I would not like to see this sort order in the management screens, because I use capitalization to ensure that essential objects ar

Re: [Zope-dev] case insensitive sorts

2000-12-07 Thread Toby Dickenson
On Thu, 07 Dec 2000 10:54:06 -0500, Shane Hathaway <[EMAIL PROTECTED]> wrote: >The one thing I wonder is whether the sort order is consistent between >different versions of Python. I actually have a Collector bug report on exactly this question. http://classic.zope.org:8080/Collector/1219/view

Re: [Zope-dev] case insensitive sorts

2000-12-07 Thread Shane Hathaway
Chris Withers wrote: > Who thinks the default python sort should stay like it is? Who thinks it > should change? > (reasons of course would be helpful, particularly if you want it to stay > like it is ;-) Python's sort() lets you sort based on not only strings but also tuples, lists, and numbers,

Re: [Zope-dev] case insensitive sorts

2000-12-07 Thread Toby Dickenson
On Wed, 06 Dec 2000 18:00:31 +, Chris Withers <[EMAIL PROTECTED]> wrote: >(reasons of course would be helpful, particularly if you want it to stay >like it is ;-) I noticed the smiley, so Im not sure how serious the suggestion is. Ill bite anyway: 1. Python doesnt distinguish between 8-bi

Re: [Zope-dev] case insensitive sorts

2000-12-07 Thread Chris Withers
Dieter Maurer wrote: > > Andy McKay writes: > > what does anyone else think > > I would not like it. Why not? ;-) Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML

Re: [Zope-dev] case insensitive sorts

2000-12-06 Thread Rik Hoekstra
> Andy McKay wrote: > > > Minor nit and patch: I've found that really for me what users want to see is > > a case insensitive sort of objects, not the current python case sensitive > > sort. So that the order of objects from dtml-in and tree is a, A, b, B as > > apposed to A, B, a, b. > > > > An

Re: [Zope-dev] case insensitive sorts

2000-12-06 Thread Dieter Maurer
Andy McKay writes: > what does anyone else think I would not like it. Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://list

Re: [Zope-dev] case insensitive sorts

2000-12-06 Thread Andy McKay
McKay, Developer. ActiveState. - Original Message - From: "Steve Alexander" <[EMAIL PROTECTED]> To: "Andy McKay" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, December 06, 2000 11:03 AM Subject: Re: [Zope-dev] case insensitive sorts > And

Re: [Zope-dev] case insensitive sorts

2000-12-06 Thread Steve Alexander
Andy McKay wrote: > Minor nit and patch: I've found that really for me what users want to see is > a case insensitive sort of objects, not the current python case sensitive > sort. So that the order of objects from dtml-in and tree is a, A, b, B as > apposed to A, B, a, b. > > Anyway Ive patched

Re: [Zope-dev] case insensitive sorts

2000-12-06 Thread Chris Withers
Andy McKay wrote: > > Anyway Ive patched dtml-in and dtml-tree to do this sort on a ignore_case > tag. Is this useful to anyone else? yes! :-) > And Ive thought of patching my Zope so > this is the default behaviour what does anyone else think. The next > thing to patch is ZCatalog... To b