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/2014-September/136342.html below:

[Python-Dev] List insert at index that is well out of range

[Python-Dev] List insert at index that is well out of range - behaves like append [Python-Dev] List insert at index that is well out of range - behaves like appendGuido van Rossum guido at python.org
Tue Sep 16 00:57:17 CEST 2014
On Mon, Sep 15, 2014 at 3:46 PM, Mark Lawrence <breamoreboy at yahoo.co.uk>
wrote:

>
> I assume it's based on the concepts of slicing.  From the docs
> "s.insert(i, x) - inserts x into s at the index given by i (same as s[i:i]
> = [x])".


Ah, right. It matches thigs like s[100:] which is the empty string if s is
shorter than 100.


> Although shouldn't that read s[i:i+1] = [x] ?
>

Should've stopped while you were ahead. :-)

'Nuff said.

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140915/7bd50db3/attachment.html>
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