Kyle Stanley wrote:
In order for this proposal to be seriously considered, I think it's necessary to cite many realistic examples where the current behavior is problematic enough to justify changing the current behavior, and that adding a str.chars() and eventually removing the ability to iterate over strings would provide a better fix than any existing solutions. Simply stating that much of the Python community considers the current behavior to be "somewhat problematic" based on previous suggestions is certainly not going to be adequately convincing, at least not to me. But, even in the case that we are able to conclude that the current behavior causes significant issues that can't be addressed as well with existing solutions, I strongly suspect that this is going to be the case of change that is far too fundamental to Python to be changed at this point, even with a distant deprecation warning and many years of advanced notice regarding the removal/change after that.
I agree. I can barely imagine what is wrong with Python's strings. Can you please provide any example? It is a common "pattern" in any languages to walk along strings, letter by letter. Python's strings provide a powerful way of doing it --as a sequence which is a fundamental type in the language. No need to dealing with indexes, terminators, lengths, boundaries, etc. I love Python because of this and hate C's and Java's strings. On the other hand, what about slices? Since slices operate in sequences and lists, if strings are not longer sequences, how would Python do slicing on strings according to your proposal? I think strings as immutable strings is indeed a wise implementation decision on Python. Thank you.