WPS440/441 on multiple loops
See original GitHub issueWith code like:
for widget in self._widgets:
await widget.update()
...
for widget in self._widgets:
await widget.set_something(state)
I get WPS440 and WPS441 due to reusing the widget variable name in the second loop.
I think that WPS441 shouldn’t apply, as we are defining a new variable, as opposed to reusing the previous value from the last loop.
Then I think also, that WPS440 shouldn’t apply, as the WPS441 stops you from reusing the first variable anyway, so shadowing a variable you’re not supposed to be using is not an issue. i.e. If WPS441 is going to make you treat them as block-scoped variables, then shadowing them shouldn’t be taken into account as they shouldn’t be treated as being in the enclosing scope.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:13 (11 by maintainers)
Top Results From Across the Web
How can I break out of multiple loops? - Stack Overflow
My first instinct would be to refactor the nested loop into a function and use return to break out.
Read more >Play multiple loops (in succession) - Anytune Help Center
Let's say you have several sections of a song that you want to practice in one go. There are a couple different approaches:...
Read more >How to perform multiple loops - Designer - Alteryx Community
Hello All, I need help to solve below problem using alteryx: Holdings Combined key CP/DV/MT Amount Net Amount net amount fke Sum of...
Read more >Breaking/continuing out of multiple loops - Ideas
Hi! SUGGESTION An easy way to break/continue within nested loops. MY REAL LIFE EXAMPLE I am looping through a list of basketball players, ......
Read more >How to Break out of multiple loops in Python ? - GeeksforGeeks
A direct approach to this problem is to iterate through all the elements of arr using a for loop and to use a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Reproduction:
Awesome! Thanks!