these need to be positional only to be assignable

This commit is contained in:
Douglas Creager 2025-11-26 16:27:23 -05:00
parent b7fb6797b4
commit 9950c126fe
2 changed files with 4 additions and 4 deletions

View File

@ -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]`

View File

@ -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]`