![]() Return foo(x: int, y: str, z: bool = False) -> List:ĭecorates foo into a callable that returns int, but still has the same parameters, including their TParams = ParameterSpecification("TParams")ĭef unwrap(f: Callable]) -> Callable:ĭef inner(*args: TParams.args, **kwargs: TParams.kwargs) -> TReturn: ![]() ![]() The typing of decorators which transform the return type of the given callable.įor example: from typing import TypeVar, Callable, Listįrom pyre_extensions import ParameterSpecification Specifications (known as argspecs in the runtime and inspect library) instead of types, allowing ParameterSpecifications are a special kind of type variable that captures callable parameter The function will raise anĪssertion error if passed None and return the value otherwise. none_throwsįunction to make assumptions about Optionals explicit. This module defines extensions to the standard “typing” module that are supported by the Pyre typechecker.
0 Comments
Leave a Reply. |