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
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for pycparser_stubs-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da151eeadd011073f43c60b3c79550ffd4ede9d8740b7c0ef3e1ce2337fdc7d0 |
|
MD5 | f2cf273099a36c42416f511145616ebb |
|
BLAKE2b-256 | 4fad8ab1fe8c587d8eed762c95955e67ef1b7ed3d504ddffc69b14f335bb81c1 |