Skip to main content

Type system extensions for use with the pyre type checker

Project description

Pyre Extensions

This module defines extensions to the standard “typing” module that are supported by the Pyre typechecker.


ArgSpecs are a special kind of type variable that captures callable parameter specifications (known as argspecs in the runtime) instead of types, allowing the typing of decorators which transform the return type of the given callable.
For example:

from typing import TypeVar, Callable, List
from pyre_extensions import ArgSpec
Tparams = ArgSpec("Tparams")
Treturn = TypeVar("Treturn")
def unwrap(f: Callable[Tparams, List[Treturn]) -> Callable[Tparams, Treturn]: ...
def foo(x: int, y: str, z: bool = False) -> List[int]:
    return [1, 2, 3]

decorates foo into a callable that returns int, but still has the same parameters, including their names and whether they are required.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyre-extensions, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size pyre_extensions-0.0.5-py3-none-any.whl (3.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pyre-extensions-0.0.5.tar.gz (2.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page