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.1.0.tar.gz
(3.2 kB
view details)
Built Distribution
File details
Details for the file sigparse-1.1.0.tar.gz
.
File metadata
- Download URL: sigparse-1.1.0.tar.gz
- Upload date:
- Size: 3.2 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 | 2e22ba86c2a2674e672cd19ab02774b7ae62be49a98a9055a3b3346fee076a5c |
|
MD5 | dc85f8b3e8a64f3455e24b9d082e7da3 |
|
BLAKE2b-256 | 0ecac83dfda18a8e2d48e97292cdf95207bedf0f5465a69fbfabad37b88a64a6 |
File details
Details for the file sigparse-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: sigparse-1.1.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 | 3b73b38e76d4fb074d9bbdbd54211f999ea69f049a5cc2e7ddf94eaab6e4dd5a |
|
MD5 | c31eee6026ee5ca357eac451488182e2 |
|
BLAKE2b-256 | d377c595da8c84d3dab12d9a5cc6dd4af1038eb533f4aeedbdff5afc3dfe302b |