You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked there are no open bugs referencing the same bug or problem
Description
The following snippet:
forxingen:
(lessifx<pivotelsemore).append(x)
Gets a buggy suggestion to change into:
(lessifx<pivotelsemore).extend(iter(gen))
The problem lies with the LHS being appended not being constant and relying on the iterated x.
Debug Information
IDE Version:
VS Code 1.71.1
Sourcery Version:
Sourcery 0.12.7
Operating system and Version:
maxOS 12.5
Appendix
Example code snippet in context:
defquick_sort(gen):
""" Haskell-style leet lazy evaluation quick_sort. It doesn't need to fully sort everything to find the N smallest elements. An example use case is iterating over potential dates by the order of their attractiveness, until one of them agrees to date you (no need to iterate over the rest after a match is found), but be warned that the odds of that may be lower if you're using functions like this one. The complexity would be O(N*log(K)) where K is the ammount iterated, in comparison to O(N*log(N)) for the full sorting algorithm. """gen=iter(gen)
try:
pivot=next(gen)
exceptStopIteration:
returnless= []
more= []
forxingen:
(lessifx<pivotelsemore).append(x)
yieldfromquick_sort(less)
yieldpivotyieldfromquick_sort(more)
The text was updated successfully, but these errors were encountered:
Checklist
Description
The following snippet:
Gets a buggy suggestion to change into:
The problem lies with the LHS being appended not being constant and relying on the iterated
x
.Debug Information
IDE Version:
VS Code 1.71.1
Sourcery Version:
Sourcery 0.12.7
Operating system and Version:
maxOS 12.5
Appendix
Example code snippet in context:
The text was updated successfully, but these errors were encountered: