Fun with fancy slicing

Dave Benjamin ramen at lackingtalent.com
Wed Oct 1 13:20:55 EDT 2003


In article <7h3isnaz6qw.fsf at pc150.maths.bris.ac.uk>, Michael Hudson wrote:
> Dave Benjamin <ramen at lackingtalent.com> writes:
> 
>> Anyone have any other interesting applications of the extended slice syntax?
> 
> You can use it in a sieve prime finder (ooh, thread crossing :-):
> ...
> but it's not especially efficient (in speed or memory).  Quite cute,
> though.

But quite expressive! I'm amazed at how small that code was. It reminds me
of the trademark quicksort implementation in Haskell, ie. it may not be
great in practice, but you can see the algorithm at a high level which makes
it easier to figure out what's going on.

Anyway, thanks. That was cool. =)

Peace,
Dave

-- 
.:[ dave benjamin (ramenboy) -:- www.ramenfest.com -:- www.3dex.com ]:.
: d r i n k i n g   l i f e   o u t   o f   t h e   c o n t a i n e r :




More information about the Python-list mailing list