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 | [EMAIL PROTECTED] | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com