The Wayback Machine - https://web.archive.org/web/20201020185418/https://github.com/wemake-services/wemake-python-styleguide/issues/1629
Skip to content
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

Forbid assigning to a slice #1629

Open
sobolevn opened this issue Sep 30, 2020 · 7 comments · May be fixed by #1661
Open

Forbid assigning to a slice #1629

sobolevn opened this issue Sep 30, 2020 · 7 comments · May be fixed by #1661

Comments

@sobolevn
Copy link
Member

@sobolevn sobolevn commented Sep 30, 2020

Rule request

Thesis

There might be some crazy examples of mutation, when assigning to a slice:

my_list = [1, 2, 3]
my_list[0:3] = [0, 0, 0]

So, let's ban this.

However, we still allow regular index assignments:

my_list = [1, 2, 3]
my_list[0] = [0, 0, 0]

Is ok.

@sobolevn sobolevn added this to the Version 0.15 aka New runtime milestone Sep 30, 2020
@sobolevn sobolevn changed the title Forbid assigning to slice Forbid assigning to a slice Sep 30, 2020
@parzuko
Copy link

@parzuko parzuko commented Oct 1, 2020

hey, can i take this issue ?

@sobolevn
Copy link
Member Author

@sobolevn sobolevn commented Oct 1, 2020

Yes, thanks a lot!

@sudo-k-runner
Copy link

@sudo-k-runner sudo-k-runner commented Oct 10, 2020

@parzuko are you working on this? if not would like to take this up.

@sobolevn
Copy link
Member Author

@sobolevn sobolevn commented Oct 10, 2020

@sudo-k-runner feel free to take it 🙂

@sudo-k-runner
Copy link

@sudo-k-runner sudo-k-runner commented Oct 10, 2020

@sobolevn cool! kinda new to this, so would be great if I can get some pointers. Thanks!

@sobolevn
Copy link
Member Author

@sobolevn sobolevn commented Oct 10, 2020

I recommed to start with our CONTRIBUTING.md and then ask any specific questions you have 👍

@sudo-k-runner
Copy link

@sudo-k-runner sudo-k-runner commented Oct 10, 2020

sure thing! Thanks 👍

@sudo-k-runner sudo-k-runner linked a pull request that will close this issue Oct 12, 2020
4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.