[Python-3000] Droping find/rfind?

Nick Coghlan ncoghlan at gmail.com
Fri Aug 25 11:50:03 CEST 2006


Fredrik Lundh wrote:
> Nick Coghlan wrote:
> 
>> With a variety of "view types", that work like the corresponding builtin type,
>> but reference the original data structure instead of creating copies
> 
> support for string views would require some serious interpreter surgery, though,
> and probably break quite a few extensions...

Why do you say that? I'm thinking about a type written in Python, intended to 
be used exactly the way I did in my strawman example - you accept a normal 
string, make a view of it, do your manipulations, then make sure that anything 
you return or yield is a normal string so other code doesn't get any nasty 
surprises.

It would be strictly an optimisation technique to allow the normal string 
operations to be used without the performance penalties associating with 
slicing large strings. Otherwise you have to choose between "readable" and 
"scalable" which is an annoying choice to be forced to make.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-3000 mailing list