[Python-3000] Iterators for dict keys, values, and items == annoying :)

Adam DePrince adam.deprince at gmail.com
Thu Mar 30 20:44:05 CEST 2006


On Thu, 2006-03-30 at 12:05 +1200, Greg Ewing wrote:
> Stefan Rank wrote:
> 
> >    A big question is: Should slicing also return views? and why not?
> 
> That's been considered before, in relation to strings.
> The stumbling block is the problem of a view of a
> small part of the object keeping the whole thing
> alive and using up memory.
> 
> While having a separate way of getting slice-views
> could be useful, I think it would be too big a
> change in semantics to make it the default
> behaviour of slicing notation.

No reason we can't make other string operations views as well ...
concatenation is one example.  If I recall, that's how snobol handles
strings, view upon view upon view.  Eww.   Maybe my memory failed me.

- Adam,




More information about the Python-3000 mailing list