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.2.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyre-extensions-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 ed3fa1d3aa14f3cb848a4abf824c30ef010337e001e3cb08eaac4006c524bde9
MD5 1f3cabb9c0f516d0288e7fe316f38bce
BLAKE2b-256 4be0d6fb72786115d200abdb348f6a65cd0ce0aeecd349d181b275307cda564a

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyre_extensions-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 80ca379bc9d295353e5081048e91cecea2e0b3c5fe2bba8141adbb1b180c92a3
MD5 7b548188dd83e181d5336fd3d573f151
BLAKE2b-256 94035e725df63fee26330c9eeffe45ec2fa9199b82f0c2d999db1f57aa4755d1

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