Skip to content

unused variable regression 0.0.26->0.0.27 #3187

@danielpopescu

Description

@danielpopescu

Summary

def buy_sell_once(prices: list[float]) -> float:
    assert len(prices) > 1
    best_buy, best_so_far = prices[0], 0.0
    for i in range(1, len(prices)):
        best_so_far = max(best_so_far, prices[i] - best_buy)
        best_buy = min(best_buy, prices[i])
    return best_so_far

with 0.0.27, we get warning: "best_buy is unused" in line 6.

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions