A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-May/079695.html below:

[Python-Dev] Slice as a copy... by design?

[Python-Dev] Slice as a copy... by design? [Python-Dev] Slice as a copy... by design?Facundo Batista facundobatista at gmail.com
Thu May 22 18:27:04 CEST 2008
2008/5/22 Scott Dial <scott+python-dev at scottdial.com>:

> If we changed Python to slice-by-reference, then tomorrow someone would be
> asking why it isn't slice-by-copy. There are pros and cons to both that are

Which are the cons of slice-by-reference of an immutable string?


> dependent on your application. It's not hard to imagine applications where
> you want to hold onto a small portion of a large string, thereby forcing the
> entire string to remain in memory. If a slices had a copy method, then I

This is a garbage collection issue. It's real, and maybe could be
optimized somehow... but I think that this un-optimization is by far
smaller than the optimization of not copying it in the first place.

-- 
. Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4