Backports python3.10 typing features into python3.8 and python3.9.
Project description
sigparse
Backports python3.10 typing features into python3.8 and 3.9.
Example
import sigparse
def func(param_a: list[str], param_b: str | int, param_c: tuple[int | None]):
...
# This returns the same result in python 3.8, 3.9, and 3.10!
sigparse.sigparse(func)
PEP604
By default PEP 604 (| for unions) is only enabled for sigparse.sigparse
.
To enable globally:
import sigparse
sigparse.global_PEP604()
Notes
Inspect
This module uses inspect behind the scenes. For that reason:
sigparse.Parameter.default
isinspect._empty
when there is no default value.sigparse.Parameter.kind
isinspect._ParameterKind
.
Annotated
typing.Annotated
will always be evaluated with include_extras=True
in python3.9.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sigparse-1.2.0.tar.gz
(3.3 kB
view details)
Built Distribution
File details
Details for the file sigparse-1.2.0.tar.gz
.
File metadata
- Download URL: sigparse-1.2.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0 CPython/3.8.13 Linux/5.15.0-1019-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0acfda370c78e6c988b2a1aa709b739668a77f9e231611200368e3587ca2d0f8 |
|
MD5 | a1339a334ccf32852570ad65da39d509 |
|
BLAKE2b-256 | aac21dc33cd8fab117bd77f88776f4beecd4b522215e214655df08895a7beecf |
File details
Details for the file sigparse-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: sigparse-1.2.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0 CPython/3.8.13 Linux/5.15.0-1019-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e050d7e749621999e1ed22ed04b950b28f441196ee19fccc3378465647fe9e2 |
|
MD5 | 2c6fb3cb8c4fbf9e2a901a5bf5c5c4fc |
|
BLAKE2b-256 | fc83cdaadb309af095278f90ceafc9da8430367488cc731459c0c052efc75e9d |