New submission from Filip Haglund:

Slicing tuples returns a copy, which is O(n) time. This could be O(1) since 
tuples are immutable, by just pointing to the same data.

This probably applies to other immutable structures as well, such as strings.

----------
components: Interpreter Core
messages: 257937
nosy: Filip Haglund
priority: normal
severity: normal
status: open
title: Make slicing of immutable structures return a view instead of a copy
type: performance
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26077>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to