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, 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 second method,
perhaps in a new module (called "textops" or something similar) that
would also include multilingual text splitters and other utilities for
working with human-readable text.

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, {}, [], '', ()]

Shane

_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to