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/2002-June/025461.html below:

[Python-Dev] behavior of inplace operations

[Python-Dev] behavior of inplace operationsGuido van Rossum guido@python.org
Mon, 17 Jun 2002 08:59:46 -0400
> Current CVS says:
> 
>    >>> a = range(12)
>    >>> t0,t1 = a,slice(2, 9)
>    >>> t0[t1] = t0[t1] + [666]
>    Traceback (most recent call last):
>      File "<stdin>", line 1, in ?
>    ValueError: attempt to assign list of size 8 to extended slice of
>    size 7
> 
> I suspect this is a bug, since I didn't ask for an extended slice.
> 
>    >>> a[2:9] = a[2:9] + [666]
>    >>> a
>    [0, 1, 2, 3, 4, 5, 6, 7, 8, 666, 9, 10, 11]
> 
> Jeremy

Yeah, I think this is a bug introduced when MWH added support for
extended slices.  I hope he'll fix it so I won't have to. :-)

--Guido van Rossum (home page: http://www.python.org/~guido/)




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