On Wed, Jun 4, 2014 at 6:22 PM, Mark Lawrence <breamore...@yahoo.co.uk> wrote:
> Single characters quite often, iteration rarely if ever, slicing all the
> time, but does that last one count?

Yes, slicing counts. What matters here is the potential impact of
internally representing strings as UTF-8 streams; when you ask for the
Nth character, it would have to scan from either the beginning or end
(more likely beginning) of the string and count, instead of doing what
CPython 3.3+ does and simply look up the header to find out the kind,
bit-shift the index by one less than that, and use that as a memory
location.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to