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.3.0.tar.gz
(3.3 kB
view details)
Built Distribution
File details
Details for the file sigparse-1.3.0.tar.gz
.
File metadata
- Download URL: sigparse-1.3.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 | bf5c518037109505abe8069fe39b9c5131c9c9a1865c354e9ae537696ac2e5d0 |
|
MD5 | abc130a1355c113179efe7d1000aeae9 |
|
BLAKE2b-256 | 0737640bebdb45965835b2feef73e9bf16a3ee0a805bd6aafe6b365a8fe3624a |
File details
Details for the file sigparse-1.3.0-py3-none-any.whl
.
File metadata
- Download URL: sigparse-1.3.0-py3-none-any.whl
- Upload date:
- Size: 4.1 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 | 5afd98277e843ff6a0674a3a98f8cb8ad8714e89ee2556bf350c6a34aaf59870 |
|
MD5 | b63b27ddb041572e64b4eca141875179 |
|
BLAKE2b-256 | 7a132b128e164439acfc73e10e234badd5a9062c51fcc33b6c0e5287820ecc20 |