mirror of https://github.com/astral-sh/ruff
not needed anymore
This commit is contained in:
parent
e476624ef2
commit
690310cea3
|
|
@ -549,10 +549,10 @@ T = TypeVar("T")
|
||||||
def invoke(fn: Callable[[A], B], value: A) -> B:
|
def invoke(fn: Callable[[A], B], value: A) -> B:
|
||||||
return fn(value)
|
return fn(value)
|
||||||
|
|
||||||
def identity(x: T, /) -> T:
|
def identity(x: T) -> T:
|
||||||
return x
|
return x
|
||||||
|
|
||||||
def head(xs: list[T], /) -> T:
|
def head(xs: list[T]) -> T:
|
||||||
return xs[0]
|
return xs[0]
|
||||||
|
|
||||||
reveal_type(invoke(identity, 1)) # revealed: Literal[1]
|
reveal_type(invoke(identity, 1)) # revealed: Literal[1]
|
||||||
|
|
|
||||||
|
|
@ -487,10 +487,10 @@ from typing import Callable
|
||||||
def invoke[A, B](fn: Callable[[A], B], value: A) -> B:
|
def invoke[A, B](fn: Callable[[A], B], value: A) -> B:
|
||||||
return fn(value)
|
return fn(value)
|
||||||
|
|
||||||
def identity[T](x: T, /) -> T:
|
def identity[T](x: T) -> T:
|
||||||
return x
|
return x
|
||||||
|
|
||||||
def head[T](xs: list[T], /) -> T:
|
def head[T](xs: list[T]) -> T:
|
||||||
return xs[0]
|
return xs[0]
|
||||||
|
|
||||||
reveal_type(invoke(identity, 1)) # revealed: Literal[1]
|
reveal_type(invoke(identity, 1)) # revealed: Literal[1]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue