

We pride ourselves in providing over 5,000 products offering the highest caliber of quality product, fast shipping, and customer service. Primus Cable supplies low voltage Ethernet cable, fiber optic cable, and accessories to a customer base spanning the nation. loads ( "", List ) # Raises `pyre_extensions.safe_json.InvalidJson` > safe_json. Examplesįor trivial JSON structures you can use builtin types: > from pyre_extensions import safe_json > from typing import List, Dict > safe_json. Input matches the expected type and raise an exception if it does not. Any)Īllows you to specify the shape of the JSON you're expecting. It is meant as a drop-in replacementįor the builtin json module but instead of returning an object of undefined shape (i.e. The safe_json module provides a type-safe way to parse JSON. Manner: together, in a function definition, as *args and **kwargs with no other parameters Because the division of parameters into these two argumentĬollections can be different each invocation, these special annotations can only be used in one Which correspond to the positional and keyword arguments for a specific call to the These ParameterSpecification variables also have two special properties, args and kwargs, 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.
