sort() method

peter@mat.aukuni.ac.nz
Wed, 15 Jul 92 17:31:56 NZST

I am a newcomer to Python and as an exercise, I am converting some of
my Perl scripts into Python. So far I am satisfied with the result and
haven't had serious difficulties. In particular I like the nice and
*readable* look of my new scripts.

During this exercise, I observed that the Python module system
encouraged me to reorganize my, sometimes not too nice, Perl scripts
into a better structured (modularized) form.

I haven't used object-oriented features yet.

However the speed of my Python scripts are far from of the perl ones.
It doesn't really worry me at the moment and anyway, it could be
a consequence of my beginner Python programming style.

One of the problems I've encountered is that I frequently used the Perl
feature which allows the user to give his own comparing function as a
parameter to the sort routine. I couldn't find anything similar in
Python and therefore the equivalent Python code segment became more
complicated.

Is there any Python style way to work around this problem?

If there was no such a way, wouldn't it be worth to add this extension
in some way to the builtin sort() method? (I hope it is not a "perlis"
wish :-)

--
           ,
Peter Dobcsanyi