mirror of https://github.com/astral-sh/ruff
these need to be positional only to be assignable
This commit is contained in:
parent
b7fb6797b4
commit
9950c126fe
|
|
@ -379,10 +379,10 @@ T = TypeVar("T")
|
|||
def invoke(fn: Callable[[A], B], value: A) -> B:
|
||||
return fn(value)
|
||||
|
||||
def identity(x: T) -> T:
|
||||
def identity(x: T, /) -> T:
|
||||
return x
|
||||
|
||||
def head(xs: list[T]) -> T:
|
||||
def head(xs: list[T], /) -> T:
|
||||
return xs[0]
|
||||
|
||||
# TODO: this should be `Literal[1]`
|
||||
|
|
|
|||
|
|
@ -334,10 +334,10 @@ from typing import Callable
|
|||
def invoke[A, B](fn: Callable[[A], B], value: A) -> B:
|
||||
return fn(value)
|
||||
|
||||
def identity[T](x: T) -> T:
|
||||
def identity[T](x: T, /) -> T:
|
||||
return x
|
||||
|
||||
def head[T](xs: list[T]) -> T:
|
||||
def head[T](xs: list[T], /) -> T:
|
||||
return xs[0]
|
||||
|
||||
# TODO: this should be `Literal[1]`
|
||||
|
|
|
|||
Loading…
Reference in New Issue