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 suggested. :-)

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 to take

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 to the

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 in

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 general, people prefer sorting

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 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 example strings seem to name

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 a

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 capitalization to ensure that

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 :-) 1.

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, because I use capitalization to

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 insensitive sorts

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) -Andy

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. The

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 seems as

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

Re: [Zope-dev] case insensitive sorts

2001-01-03 Thread Andy McKay
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, 2001 8:46 AM Subject: Re: [Zope-dev] ca

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 question

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

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-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 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 Andy McKay
ot; [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 anyone else think I would not like it. Why not? ;-) I w

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 least

[Zope-dev] case insensitive sorts

2000-12-06 Thread Andy McKay
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 dtml-in and dtml-tree to do

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 Andy 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 Andy McKay wrote: Minor nit a

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 -

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. Anyway Ive