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.

ArgSpec

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]: ...
@unwrap
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.

Source Distribution

pyre-extensions-0.0.5.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

pyre_extensions-0.0.5-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file pyre-extensions-0.0.5.tar.gz.

File metadata

  • Download URL: pyre-extensions-0.0.5.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.3rc1+

File hashes

Hashes for pyre-extensions-0.0.5.tar.gz
Algorithm Hash digest
SHA256 424d0f83f56ecdf4c79ff935d4b1d1edff10ff9f5e250a3f1cd1fd1f55877df0
MD5 8304618d010e0c30a709d496d9e648d2
BLAKE2b-256 d051507ff473a8ca17a871db18ec8f4d6317c10b113f1a93e15ffe178761b9d6

See more details on using hashes here.

Provenance

File details

Details for the file pyre_extensions-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: pyre_extensions-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.3rc1+

File hashes

Hashes for pyre_extensions-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f6f052bcd654f94f9556faf79ff50761cbccec59a25abb3bf47d8dd125763dd3
MD5 2577011ba7ab4697d86622710a9534ec
BLAKE2b-256 8ea76b44ac7d1232878eab98461cbdf8896ba0627516f749c0efec88142b4077

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page