Backports python3.10 typing features into python 3.7 and newer.
Project description
sigparse
Backports python3.10 typing features into python 3.7, 3.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.7, 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.3.1.tar.gz
(3.4 kB
view details)
Built Distribution
File details
Details for the file sigparse-1.3.1.tar.gz
.
File metadata
- Download URL: sigparse-1.3.1.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.8.13 Linux/5.15.0-1019-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dba7ac4413322673287241acec03d7f6dbbb171a1a6dd4100506b81e4d9241c |
|
MD5 | efddfeedbac88c80539ff6e5e0a47f4b |
|
BLAKE2b-256 | 58ffa591fd2d36d9623eb00651c66c53cc8d04adfdd97d7b3880679d2680e836 |
File details
Details for the file sigparse-1.3.1-py3-none-any.whl
.
File metadata
- Download URL: sigparse-1.3.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.8.13 Linux/5.15.0-1019-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8243d22ce85b0211eb9e11e5acaaf34094d63138b104708e0975ac2150a15150 |
|
MD5 | d2c9fee8eeb618a812db4da8cb1f234a |
|
BLAKE2b-256 | e384e93bcabbc05f2b898bc17a737bd401c0f95290018161af525454996c2bcb |