On Nov 18, 2013 3:06 AM, "Chris Angelico" <ros...@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.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to