Skip to content

Slice assignment/deletion is not implemented #509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pfalcon opened this issue Apr 19, 2014 · 3 comments
Closed

Slice assignment/deletion is not implemented #509

pfalcon opened this issue Apr 19, 2014 · 3 comments

Comments

@pfalcon
Copy link
Contributor

pfalcon commented Apr 19, 2014

We don't have following weird stuff implemented:

>>> a = [1,2,3,4]
>>> a[1:3] = [10,11,12,13]
>>> a
[1, 10, 11, 12, 13, 4]
>>> del a[2:5]
>>> a
[1, 10, 4]

This first of all relevant for lists, but should watch out for other types too.

@lurch
Copy link
Contributor

lurch commented Apr 21, 2014

...and this also works with the 3-parameter form of slicing
(just tested in CPython3.4)

>>> a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> a[-8:8:2] = ['a', 'b', 'c']
>>> a
[0, 1, 'a', 3, 'b', 5, 'c', 7, 8, 9]
>>> del a[-9:8:2]
>>> a
[0, 'a', 'b', 'c', 8, 9]

@pfalcon
Copy link
Contributor Author

pfalcon commented May 10, 2014

94d8246 starts to tackle this.

@pfalcon
Copy link
Contributor Author

pfalcon commented Jun 2, 2014

Implementation for lists is now pretty complete. Closing for now.

@pfalcon pfalcon closed this as completed Jun 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants