Greg Ewing wrote:
> On 24/02/20 9:32 am, jdve...@gmail.com wrote:
> > It is a common "pattern" in any languages to walk
> > along strings,
> > letter by letter.
> > Maybe in some other languages, but I very rarely find myself doing
> that in Python. There is almost always some higher level way of
> doing what I want.

Not talking about how frequent walking on strings is done. I just saying that 
most languages provide a "pattern" (say, a way) of looping on strings (via 
indexing, via iterators, etc.) So, most languages, in some manner, "use" 
strings as they are sequences of characters. Like Python does. Since Python has 
a sequence type, strings were modelled as character sequence-objects and so 
they behave.

In your opinion, if strings should not be sequences in Python, what they should 
be?

> > if strings are not longer sequences, how would
> > Python do slicing on strings
> > It's quite possible for a type to support slicing but not indexing.

Yeah, of course... do you think that we need to change the current syntax and 
the underlying string model to accommodate slicing but not indexing? What are 
we going to gain and what are we going to lose?
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/EMOJ6WYZA5F5QAFZ6CHQBFQ2IVGIS6TX/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to