PEP 561 type stubs for pycparser
Project description
pycparser-stubs
Type information for pycparser.
warning
This typing stub package is mainly written according to C language section of cppreference.com and runtime tests, so there can be wrong annotations.
Also, I haven't tested it with mypy, but it is usable with Pylance.
type alias
All type alias only exist in this package and is not avaliable at runtime. Put them in quotes if you want you use them to annotate. For example:
from pycparser import c_ast
def get_decl_name(decl: 'c_ast.Declarator') -> str:
while type(decl) != c_ast.TypeDecl:
decl = decl.type
return decl.declname or ''
Without quotes you will get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'pycparser.c_ast' has no attribute 'Declarator'
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pycparser_stubs-0.0.1-py3-none-any.whl.
File metadata
- Download URL: pycparser_stubs-0.0.1-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da151eeadd011073f43c60b3c79550ffd4ede9d8740b7c0ef3e1ce2337fdc7d0
|
|
| MD5 |
f2cf273099a36c42416f511145616ebb
|
|
| BLAKE2b-256 |
4fad8ab1fe8c587d8eed762c95955e67ef1b7ed3d504ddffc69b14f335bb81c1
|