Christopher Barker wrote:
I've always wondered how disruptive it would be to add a char type
I'm not sure if it would help much. Usually the problem with strings being sequences of strings lies in the fact that they're sequences at all. Code that operates generically on nested sequences often has to special-case strings so that it can treat them as atomic values. Having them be sequences of something else wouldn't change that. If I were to advocate changing anything in that area, it would be to make strings not be sequences. They would support slicing, but not indexing single characters, and would not be directly iterable. If you really wanted to iterate over characters, there could be a method such as s.chars() giving a sequence view. But that would be a disruptive enough change for so little benefit that I don't expect it to ever happen. -- Greg _______________________________________________ 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/LUR6URJANVGIVJCWQMIUEM7XASTLV47B/ Code of Conduct: http://python.org/psf/codeofconduct/