[docs] [issue21667] Clarify status of O(1) indexing semantics of str objects

Nick Coghlan report at bugs.python.org
Thu Jun 5 13:02:23 CEST 2014


New submission from Nick Coghlan:

Based on the recent python-dev thread, I propose the following "CPython implementation detail" note in the "Strings" entry of https://docs.python.org/3/reference/datamodel.html#objects-values-and-types

"CPython currently guarantees O(1) access to arbitrary code points when indexing and slicing a string. Python implementations are required to index and slice strings as arrays of code points, but are not required to guarantee O(1) access to arbitrary locations within the string. This allows implementations to use variable width encodings for their internal string representation."

----------
assignee: docs at python
components: Documentation
messages: 219793
nosy: docs at python, ncoghlan
priority: normal
severity: normal
status: open
title: Clarify status of O(1) indexing semantics of str objects
versions: Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21667>
_______________________________________


More information about the docs mailing list