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