Oh look, another language (ceylon)

Ian Kelly ian.g.kelly at gmail.com
Mon Nov 18 07:29:09 EST 2013


On Nov 18, 2013 3:06 AM, "Chris Angelico" <rosuav at gmail.com> wrote:
>
> I'm trying to figure this out. Reading the docs hasn't answered this.
> If each character in a string is a 32-bit Unicode character, and (as
> can be seen in the examples) string indexing and slicing are
> supported, then does string indexing mean counting from the beginning
> to see if there were any surrogate pairs?

The string reference says:

"""Since a String has an underlying UTF-16 encoding, certain operations are
expensive, requiring iteration of the characters of the string. In
particular, size requires iteration of the whole string, and get(), span(),
and segment() require iteration from the beginning of the string to the
given index."""

The get and span operations appear to be equivalent to indexing and slicing.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20131118/1c4e541c/attachment.html>


More information about the Python-list mailing list