[Python-Dev] partition() (was: Remove str.find in 3.0?)

Terry Reedy tjreedy at udel.edu
Tue Aug 30 07:12:41 CEST 2005


"Raymond Hettinger" <raymond.hettinger at verizon.net> wrote in
> Yes, there is a precise spec and yes it always returns three strings.

While the find/index discussion was about "what is the best way to indicate 
'cannot answer'", part of the conclusion is that any way can be awkward. 
So I am generally in favor of defining a function, when possible, so that 
it can always deliver an answer (giving inputs of the appropriate types) 
and so that the 'best way' question is moot.  Nicely done.

I think the name 'partition' is fine too.  It does not preclude putting a 
quicksort-type partition function in a module of list functions.  The only 
alternative I can think of is 'tripart', but I do *not* prefer that.

Terry J. Reedy





More information about the Python-Dev mailing list