Summary
I noticed something weird with UP047, foo triggers a warning while foo2 does not.
from collections.abc import Callable
from typing import TypeVar
T = TypeVar("T")
def foo(t: list[T]) -> T:
return t[0]
def foo2(t: list[T], c: Callable[[T], None]) -> T:
c(t[0])
return t[1]
Playground: https://play.ruff.rs/cd7af9a8-0532-40fe-83c7-4282a658808c
Version
v0.12.7