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. :-)
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
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
* 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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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,
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
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
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
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
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
, 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
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 -
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
29 matches
Mail list logo